Don't show svnversion non-version response

svn: r21006
This commit is contained in:
Doug Blank 2013-01-06 00:34:12 +00:00
parent d60bbe812b
commit 5f24c8834c

View File

@ -37,6 +37,17 @@ def get_svn_revision(path=""):
stdout=subprocess.PIPE, stderr=subprocess.PIPE) stdout=subprocess.PIPE, stderr=subprocess.PIPE)
(stdout, stderr) = p.communicate() (stdout, stderr) = p.communicate()
except: except:
pass return "" # subprocess failed
return "-r" + cuni(stdout) if stdout else "" # subprocess worked
if stdout: # has output
stdout = cuni(stdout) # get a proper string
if " " in stdout: # one of svnversion's non-version responses:
# 'Unversioned directory'
# 'Unversioned file'
# 'Uncommitted local addition, copy or move'
return ""
else:
return "-r" + stdout
else: # no output from svnversion
return ""