From 8f8fb009a751210801955a262947ef90817a2f61 Mon Sep 17 00:00:00 2001 From: "evan@chromium.org" Date: Tue, 20 Jul 2010 23:05:37 +0000 Subject: sync-webkit-git: fixes to work on Windows You need shell=True on Windows for it to understand PATH. (Python's subprocess module is confusing: the Windows semantics are significantly different than the Unix ones. Either way on Windows, the command array is flattened and shell-escaped.) Review URL: http://codereview.chromium.org/3032009 git-svn-id: svn://svn.chromium.org/chrome/trunk/src@53119 0039d316-1c4b-4281-b951-d872f2087c98 --- tools/sync-webkit-git.py | 9 +++++++-- 1 file changed, 7 insertions(+), 2 deletions(-) diff --git a/tools/sync-webkit-git.py b/tools/sync-webkit-git.py index 239e6ad..1af8836f 100755 --- a/tools/sync-webkit-git.py +++ b/tools/sync-webkit-git.py @@ -23,7 +23,10 @@ MAGIC_GCLIENT_BRANCH = 'refs/heads/gclient' def RunGit(command): """Run a git subcommand, returning its output.""" - proc = subprocess.Popen(['git'] + command, stdout=subprocess.PIPE) + # On Windows, use shell=True to get PATH interpretation. + shell = (os.name == 'nt') + proc = subprocess.Popen(['git'] + command, shell=shell, + stdout=subprocess.PIPE) return proc.communicate()[0].strip() def GetWebKitRev(): @@ -48,8 +51,10 @@ def FindSVNRev(target_rev): # regexp matching the git-svn line from the log. git_svn_re = re.compile(r'^\s+git-svn-id: [^@]+@(\d+) ') + # On Windows, use shell=True to get PATH interpretation. + shell = (os.name == 'nt') log = subprocess.Popen(['git', 'log', '--no-color', '--first-parent', - '--pretty=medium', 'origin'], + '--pretty=medium', 'origin'], shell=shell, stdout=subprocess.PIPE) # Track whether we saw a revision *later* than the one we're seeking. saw_later = False -- cgit v1.1