tronds

Fetch SVN revision number

Oct 7th, 2012
302
0
Never
1
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Python 0.35 KB | None | 0 0
  1. def fetchrev(svndir):
  2.     '''Define svndir. Assuming SVN is installed. SVN commands should be the same crossplatform'''
  3.     from subprocess import check_output
  4.     svncmd = "svn info --revision HEAD " + svndir ## Space needed
  5.     revision = check_output(svncmd).split() ## Make list
  6.     revnum = revision.index("Revision:") + 1
  7.     return revision[revnum]
Advertisement
Comments
  • Comment was deleted
Add Comment
Please, Sign In to add comment