From 57848548374cbe92a5a54492e29b3190f4ce1339 Mon Sep 17 00:00:00 2001 From: "sgk@google.com" Date: Tue, 16 Jun 2009 21:27:57 +0000 Subject: 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 --- build/util/lastchange.py | 10 ++++++---- 1 file changed, 6 insertions(+), 4 deletions(-) (limited to 'build/util') 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 -- cgit v1.1