Chromium Code Reviews| Index: runtime/tools/make_version.py |
| diff --git a/runtime/tools/make_version.py b/runtime/tools/make_version.py |
| index c63f6a5b4c047fc66555fef50f8da8b376064f55..e3d8a70f779e5d21005c933914b68fc6cf6671fb 100644 |
| --- a/runtime/tools/make_version.py |
| +++ b/runtime/tools/make_version.py |
| @@ -35,19 +35,23 @@ def getRevision(): |
| debugLog("Using svn to get revision") |
| cmd = ['svn', 'info'] |
| else: |
| - debugLog("Using git svn to get revision") |
| - cmd = ['git', 'svn', 'info'] |
| - try: |
| - debugLog("Running command to get revision: %s" % cmd) |
| - proc = subprocess.Popen(cmd, |
| - stdout=subprocess.PIPE, stderr=subprocess.STDOUT) |
| - revision = proc.communicate()[0].split('\n')[4].split(' ')[1] |
| - debugLog("Got revision: %s" % revision) |
| - return revision |
| - except Exception: |
| - # If we can't get any revision info (due to lack of tooling) return ''. |
| - return '' |
| - |
| + git_proc = subprocess.Popen( |
|
Ivan Posva
2012/10/26 02:57:06
I know this was already an issue previously: What
Mads Ager (google)
2012/10/26 06:26:47
Yeah, I actually did remove a try: block from here
|
| + ['git', 'branch', '-r'], |
| + stdout=subprocess.PIPE, stderr=subprocess.STDOUT) |
| + if 'git-svn' in git_proc.communicate()[0]: |
| + debugLog("Using git svn to get revision") |
| + cmd = ['git', 'svn', 'info'] |
| + else: |
| + # Cannot get revision because we are not in svn or |
| + # git svn checkout. |
| + debugLog("Could not get revision: not an svn or git-svn checkout?") |
| + return '' |
| + debugLog("Running command to get revision: %s" % cmd) |
| + proc = subprocess.Popen(cmd, |
| + stdout=subprocess.PIPE, stderr=subprocess.STDOUT) |
| + revision = proc.communicate()[0].split('\n')[4].split(' ')[1] |
| + debugLog("Got revision: %s" % revision) |
| + return revision |
| def makeVersionString(version_file): |
| id = platform.system() |