made svn revision calculation also work with trunk...

...only git-svn (patch by ivan_i)
This commit is contained in:
Gunter Labes 2008-11-17 10:38:47 +00:00
parent fda6587d7f
commit 226c9288c7

View file

@ -334,7 +334,10 @@ if not env['static_test']:
if os.path.exists('.git'):
try:
env["svnrev"] = Popen(Split("git-svn find-rev refs/remotes/trunk"), stdout=PIPE).communicate()[0].rstrip("\n")
env["svnrev"] = Popen(Split("git-svn find-rev refs/remotes/trunk"), stdout=PIPE, stderr=PIPE).communicate()[0].rstrip("\n")
if not env["svnrev"]:
# If you use git-svn for one svn path only there's no refs/remotes/trunk, only git-svn branch
env["svnrev"] = Popen(Split("git-svn find-rev git-svn"), stdout=PIPE, stderr=PIPE).communicate()[0].rstrip("\n")
# if git-svn can't find HEAD it's a local commit
if Popen(Split("git-svn find-rev HEAD"), stdout=PIPE).communicate()[0].rstrip("\n") == "":
env["svnrev"] += "L"