simplified and extended svnrev code when git-svn is used:

* append L when there are local commits

  * append M when there are uncommitted local changes
This commit is contained in:
Gunter Labes 2008-09-08 22:51:12 +00:00
parent 2df117984e
commit d852c4edc7

View file

@ -300,15 +300,12 @@ if env["PLATFORM"] == 'darwin': # Mac OS X
if os.path.exists('.git'):
try:
extra_version = "";
modified = "";
env["svnrev"] = "";
while env["svnrev"] == "" and extra_version != "^^^^^^^^^^^^^":
env["svnrev"] = Popen(Split("git-svn find-rev HEAD" + extra_version), stdout=PIPE).communicate()[0].rstrip("\n")
extra_version += "^"
if extra_version != "^":
env["svnrev"] = Popen(Split("git-svn find-rev refs/remotes/trunk"), stdout=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"
if Popen(Split("git diff --exit-code --quiet")).returncode == 1:
env["svnrev"] += "M"
except:
env["svnrev"] = ""
else: