From fc127acd4a2b24b728f78e3f7975ad54548b9209 Mon Sep 17 00:00:00 2001 From: "scottmg@google.com" Date: Wed, 1 Feb 2012 21:52:41 +0000 Subject: 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 --- build/util/lastchange.py | 4 +--- 1 file changed, 1 insertion(+), 3 deletions(-) (limited to 'build/util') 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 -- cgit v1.1