Chromium Code Reviews| Index: gcl.py |
| =================================================================== |
| --- gcl.py (revision 77944) |
| +++ gcl.py (working copy) |
| @@ -1063,12 +1063,21 @@ |
| os.write(handle, text) |
| os.close(handle) |
| - if not silent: |
| - os.system(GetEditor() + " " + filename) |
| + # Open up the default editor in the system to get the CL description. |
| + # 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 = [GetEditor(), filename] |
| + if sys.platform == 'win32': |
| + msysgit_found = os.environ['PATH'].find('mingw\\bin') != -1 |
|
M-A Ruel
2011/03/12 18:27:28
if sys.platform == 'win32' and 'mingw\\bin' in os.
Mohamed Mansour
2011/03/12 18:36:57
Done.
|
| + if msysgit_found: |
| + cmd.insert(0, 'env') |
| + try: |
| + if not silent: |
| + subprocess.check_call(cmd) |
| + result = gclient_utils.FileRead(filename, 'r') |
| + finally: |
| + os.remove(filename) |
| - result = gclient_utils.FileRead(filename, 'r') |
| - os.remove(filename) |
| - |
| if not result: |
| return 0 |