diff options
author | sgk@google.com <sgk@google.com@0039d316-1c4b-4281-b951-d872f2087c98> | 2009-06-16 21:27:57 +0000 |
---|---|---|
committer | sgk@google.com <sgk@google.com@0039d316-1c4b-4281-b951-d872f2087c98> | 2009-06-16 21:27:57 +0000 |
commit | 57848548374cbe92a5a54492e29b3190f4ce1339 (patch) | |
tree | 93c2ed7bb51745fa47aac99129eaae9bf1dfde77 /build/util | |
parent | 6d47e4ba65c3f1a9344e0bc8e7bafc8092035de3 (diff) | |
download | chromium_src-57848548374cbe92a5a54492e29b3190f4ce1339.zip chromium_src-57848548374cbe92a5a54492e29b3190f4ce1339.tar.gz chromium_src-57848548374cbe92a5a54492e29b3190f4ce1339.tar.bz2 |
Fetch the SVN revision number correctly regardless of line endings
returned by any version of Python on any platform.
BUG=14187
TEST=none
Review URL: http://codereview.chromium.org/126227
git-svn-id: svn://svn.chromium.org/chrome/trunk/src@18533 0039d316-1c4b-4281-b951-d872f2087c98
Diffstat (limited to 'build/util')
-rw-r--r-- | build/util/lastchange.py | 10 |
1 files changed, 6 insertions, 4 deletions
diff --git a/build/util/lastchange.py b/build/util/lastchange.py index 583ca1a..1b68acd 100644 --- a/build/util/lastchange.py +++ b/build/util/lastchange.py @@ -23,13 +23,14 @@ def svn_fetch_revision(): try: p = subprocess.Popen(['svn', 'info'], stdout=subprocess.PIPE, - stderr=subprocess.PIPE) - except OSError: + stderr=subprocess.PIPE, + shell=(sys.platform=='win32')) + except OSError, e: # 'svn' is apparently either not installed or not executable. return None revision = None if p: - svn_re = re.compile('^Revision:\s+(\S+)$', re.M) + svn_re = re.compile('^Revision:\s+(\d+)', re.M) m = svn_re.search(p.stdout.read()) if m: revision = m.group(1) @@ -45,7 +46,8 @@ def git_fetch_id(): try: p = subprocess.Popen(['git', 'log', '-1'], stdout=subprocess.PIPE, - stderr=subprocess.PIPE) + stderr=subprocess.PIPE, + shell=(sys.platform=='win32')) except OSError: # 'git' is apparently either not installed or not executable. return None |