Windows: Pass shell=True so Popen can run a batch file (issue #1091).
git-svn-id: https://chromiumembedded.googlecode.com/svn/trunk@1462 5089003a-bbd8-11dd-ad1f-f1f9622dbc98
This commit is contained in:
parent
b80d75f07d
commit
b00630d039
|
@ -3,12 +3,14 @@
|
||||||
# can be found in the LICENSE file
|
# can be found in the LICENSE file
|
||||||
|
|
||||||
from subprocess import Popen, PIPE
|
from subprocess import Popen, PIPE
|
||||||
|
import sys
|
||||||
|
|
||||||
def get_svn_revision(path=".", branch="master"):
|
def get_svn_revision(path=".", branch="master"):
|
||||||
svn_rev = "None"
|
svn_rev = "None"
|
||||||
cmd = ("git log --grep=^git-svn-id: -n 1 %s" % branch).split()
|
cmd = ("git log --grep=^git-svn-id: -n 1 %s" % branch).split()
|
||||||
try:
|
try:
|
||||||
process = Popen(cmd, cwd=path, stdout = PIPE, stderr = PIPE)
|
process = Popen(cmd, cwd=path, stdout = PIPE, stderr = PIPE,
|
||||||
|
shell=(sys.platform == 'win32'))
|
||||||
for line in process.stdout:
|
for line in process.stdout:
|
||||||
if line.find("git-svn-id") > 0:
|
if line.find("git-svn-id") > 0:
|
||||||
svn_rev = line.split("@")[1].split()[0]
|
svn_rev = line.split("@")[1].split()[0]
|
||||||
|
|
Loading…
Reference in New Issue