summaryrefslogtreecommitdiffstats
path: root/build/util
diff options
context:
space:
mode:
authorcaseq@google.com <caseq@google.com@0039d316-1c4b-4281-b951-d872f2087c98>2011-01-24 16:11:12 +0000
committercaseq@google.com <caseq@google.com@0039d316-1c4b-4281-b951-d872f2087c98>2011-01-24 16:11:12 +0000
commit41ec9c03d06d7da658656815bb8f411ae1d8cbcf (patch)
treeb5af0e60b8411e35718cb5f72b1f516e0ccdd7da /build/util
parentdfa56f66fde2be048247a3c992dc579db409d5f2 (diff)
downloadchromium_src-41ec9c03d06d7da658656815bb8f411ae1d8cbcf.zip
chromium_src-41ec9c03d06d7da658656815bb8f411ae1d8cbcf.tar.gz
chromium_src-41ec9c03d06d7da658656815bb8f411ae1d8cbcf.tar.bz2
Fixed invocation of "git svn info" under win32.
TBR=evan BUG=70606 TEST=none git-svn-id: svn://svn.chromium.org/chrome/trunk/src@72335 0039d316-1c4b-4281-b951-d872f2087c98
Diffstat (limited to 'build/util')
-rwxr-xr-xbuild/util/lastchange.py12
1 files changed, 9 insertions, 3 deletions
diff --git a/build/util/lastchange.py b/build/util/lastchange.py
index a91a520..07e2a69 100755
--- a/build/util/lastchange.py
+++ b/build/util/lastchange.py
@@ -29,12 +29,18 @@ def FetchSVNRevision(command, directory):
Returns:
a VersionInfo object or None on error.
"""
+
+ # Force shell usage under cygwin & win32. This is a workaround for
+ # mysterious loss of cwd while invoking cygwin's git.
+ # We can't just pass shell=True to Popen, as under win32 this will
+ # cause CMD to be used, while we explicitly want a cygwin shell.
+ if sys.platform in ('cygwin', 'win32'):
+ command = [ 'sh', '-c', ' '.join(command) ];
try:
proc = subprocess.Popen(command,
stdout=subprocess.PIPE,
stderr=subprocess.PIPE,
- cwd=directory,
- shell=(sys.platform=='win32'))
+ cwd=directory)
except OSError:
# command is apparently either not installed or not executable.
return None
@@ -65,7 +71,7 @@ def FetchVersionInfo(default_lastchange, directory=None):
from some appropriate revision control system.
"""
version_info = FetchSVNRevision(['svn', 'info'], directory)
- if not version_info and sys.platform in ('linux2',):
+ if not version_info:
version_info = FetchSVNRevision(['git', 'svn', 'info'], directory)
if not version_info:
if default_lastchange and os.path.exists(default_lastchange):