summaryrefslogtreecommitdiffstats
path: root/build/util
diff options
context:
space:
mode:
authorscottmg@google.com <scottmg@google.com@0039d316-1c4b-4281-b951-d872f2087c98>2012-02-01 21:52:41 +0000
committerscottmg@google.com <scottmg@google.com@0039d316-1c4b-4281-b951-d872f2087c98>2012-02-01 21:52:41 +0000
commitfc127acd4a2b24b728f78e3f7975ad54548b9209 (patch)
tree5d236cace511a91c4cc706115862261b351c15e2 /build/util
parentb8bdc427dc7802592bb2fea2b042f1db9667cd61 (diff)
downloadchromium_src-fc127acd4a2b24b728f78e3f7975ad54548b9209.zip
chromium_src-fc127acd4a2b24b728f78e3f7975ad54548b9209.tar.gz
chromium_src-fc127acd4a2b24b728f78e3f7975ad54548b9209.tar.bz2
Fix lastchange.py when running on native win32 python
When running as runhooks, it's not run via cygwin like it was when run in the build, and isn't able to find git. I believe the test that checked for both cygwin and win32 before was incorrect (but was always run via cygwin before so didn't matter). Additionally, when runhooks runs it, it's from above src/, so the cwd isn't in the repo. So, pass in the directory of the script itself so that git can find its repo. BUG=112264 Committed: https://src.chromium.org/viewvc/chrome?view=rev&revision=120089 Review URL: https://chromiumcodereview.appspot.com/9317037 git-svn-id: svn://svn.chromium.org/chrome/trunk/src@120110 0039d316-1c4b-4281-b951-d872f2087c98
Diffstat (limited to 'build/util')
-rwxr-xr-xbuild/util/lastchange.py4
1 files changed, 1 insertions, 3 deletions
diff --git a/build/util/lastchange.py b/build/util/lastchange.py
index d419f92..a101341e 100755
--- a/build/util/lastchange.py
+++ b/build/util/lastchange.py
@@ -73,20 +73,18 @@ def RunGitCommand(directory, command):
A process object or None.
"""
command = ['git'] + command
- shell = True
# Force shell usage under cygwin. 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 == 'cygwin':
command = ['sh', '-c', ' '.join(command)]
- shell = False
try:
proc = subprocess.Popen(command,
stdout=subprocess.PIPE,
stderr=subprocess.PIPE,
cwd=directory,
- shell=shell)
+ shell=(sys.platform=='win32'))
return proc
except OSError:
return None