From 3e48aa74c0fb4c15f0f705b488c3b484546f1e82 Mon Sep 17 00:00:00 2001 From: "mhm@chromium.org" Date: Sun, 13 Mar 2011 22:32:17 +0000 Subject: [PATCH] Reland Usage of TERM to distinguish between msys and cygwin. BUG=70548 TEST=check $TERM in windows Review URL: http://codereview.chromium.org/6683035 git-svn-id: svn://svn.chromium.org/chrome/trunk/tools/depot_tools@77978 0039d316-1c4b-4281-b951-d872f2087c98 --- gcl.py | 5 ++--- git_cl/git_cl.py | 5 ++--- 2 files changed, 4 insertions(+), 6 deletions(-) diff --git a/gcl.py b/gcl.py index ce259bcfa7..d6e9deb7f4 100755 --- a/gcl.py +++ b/gcl.py @@ -1065,9 +1065,8 @@ def CMDchange(args): # Open up the default editor in the system to get the CL description. cmd = [GetEditor(), 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. + if sys.platform == 'win32' and os.environ.get('TERM') == 'msys': + # Msysgit requires the usage of 'env' to be present. cmd.insert(0, 'env') try: if not silent: diff --git a/git_cl/git_cl.py b/git_cl/git_cl.py index 3b7ca33429..c3631e6788 100644 --- a/git_cl/git_cl.py +++ b/git_cl/git_cl.py @@ -712,9 +712,8 @@ def UserEditedLog(starting_text): # 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. + if sys.platform == 'win32' and os.environ.get('TERM') == 'msys': + # Msysgit requires the usage of 'env' to be present. cmd.insert(0, 'env') try: subprocess.check_call(cmd)