Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(69)

Unified Diff: git_cl/git_cl.py

Issue 6679019: msysgit - Fix issue where git cl doesn't recognize editor. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/tools/depot_tools/
Patch Set: '' Created 9 years, 9 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View side-by-side diff with in-line comments
Download patch
« no previous file with comments | « no previous file | no next file » | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: git_cl/git_cl.py
===================================================================
--- git_cl/git_cl.py (revision 77908)
+++ git_cl/git_cl.py (working copy)
@@ -710,17 +710,20 @@
fileobj.write(starting_text)
fileobj.close()
- ret = subprocess.call(editor + ' ' + filename, shell=True)
- if ret != 0:
+ result = None
M-A Ruel 2011/03/12 02:17:43 not needed
+ try:
+ subprocess.check_call(['env', editor, filename], shell=True)
+ fileobj = open(filename)
+ result = fileobj.read()
+ fileobj.close()
+ finally:
os.remove(filename)
+
+ if not result:
return
-
- fileobj = open(filename)
- text = fileobj.read()
- fileobj.close()
- os.remove(filename)
+
stripcomment_re = re.compile(r'^#.*$', re.MULTILINE)
- return stripcomment_re.sub('', text).strip()
+ return stripcomment_re.sub('', result).strip()
def ConvertToInteger(inputval):
« no previous file with comments | « no previous file | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698