File: revision.py

package info (click to toggle)
imagevis3d 2.0.1-5
  • links: PTS, VCS
  • area: main
  • in suites: wheezy
  • size: 7,872 kB
  • sloc: cpp: 53,586; sh: 788; ansic: 292; xml: 258; python: 35; makefile: 16
file content (10 lines) | stat: -rw-r--r-- 442 bytes parent folder | download
1
2
3
4
5
6
7
8
9
10
# A replacement for "svn info . | grep Revision | awk '{print $2}',
# because windows' shell is worthless.
import subprocess
import sys

p1 = subprocess.Popen(["svn", "info", "%s" % sys.argv[1]], stdout=subprocess.PIPE)
p2 = subprocess.Popen(["grep", "Revision"], stdin=p1.stdout, stdout=subprocess.PIPE)
p3 = subprocess.Popen(["awk", "{print $2}"], stdin=p2.stdout, stdout=subprocess.PIPE)
output = p3.communicate()[0]
print output.rstrip()