Commit 3d4d7edc authored by mhm@chromium.org's avatar mhm@chromium.org

msysgit - Fix issue where git cl doesn't recognize editor.

The unix editor doesn't popup resulting in a unsuccessful upload. This change successfully fixes it.

BUG=70550
TEST=git cl upload works as expected under msysgit.
Review URL: http://codereview.chromium.org/6679019

git-svn-id: svn://svn.chromium.org/chrome/trunk/tools/depot_tools@77910 0039d316-1c4b-4281-b951-d872f2087c98
parent 0f9ee77b
......@@ -710,17 +710,20 @@ def UserEditedLog(starting_text):
fileobj.write(starting_text)
fileobj.close()
ret = subprocess.call(editor + ' ' + filename, shell=True)
if ret != 0:
result = None
try:
subprocess.check_call(['env', editor, filename], shell=True)
fileobj = open(filename)
result = fileobj.read()
fileobj.close()
finally:
os.remove(filename)
return
fileobj = open(filename)
text = fileobj.read()
fileobj.close()
os.remove(filename)
if not result:
return
stripcomment_re = re.compile(r'^#.*$', re.MULTILINE)
return stripcomment_re.sub('', text).strip()
return stripcomment_re.sub('', result).strip()
def ConvertToInteger(inputval):
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment