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

Unified Diff: git_cl/git_cl.py

Issue 6680019: Reland - Support msysgit in gcl and git-cl... (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 | « gcl.py ('k') | 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 77945)
+++ git_cl/git_cl.py (working copy)
@@ -710,9 +710,14 @@
fileobj.write(starting_text)
fileobj.close()
- result = None
+ # Open up the default editor in the system to get the CL description.
+ cmd = [editor, filename]
+ if sys.platform == 'win32' and 'mingw\\bin' in os.environ['PATH']:
+ # Msysgit requires the usage of 'env' to be present. The only way to
+ # accomplish that is by reading the environment variable for mingw\bin.
+ cmd.insert(0, 'env')
try:
- subprocess.check_call(['env', editor, filename], shell=True)
+ subprocess.check_call(cmd)
TVL 2011/03/14 13:31:54 this has broken macosx and probably link when folk
TVL 2011/03/14 13:42:16 Sorry, it's not env as much as shell=True.
Mohamed Mansour 2011/03/14 14:01:33 Hi TVL, would changing cmd = [editor, filename] to
fileobj = open(filename)
result = fileobj.read()
fileobj.close()
« no previous file with comments | « gcl.py ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698