From 7888d9796b9d0615ff65aec5fe70a6fa3f98806a Mon Sep 17 00:00:00 2001 From: "jam@chromium.org" Date: Sun, 13 Mar 2011 21:14:51 +0000 Subject: [PATCH] Revert 77954 - Use TERM to distinguish between console and msysgit. It is cleaner this way since in Win32 console, the value is always "dumb" while in msysgit it is always "msys" The user shouldn't change the value of $TERM in msysgit otherwise their whole copy of msysgit will be flaky. BUG=70548 TEST=check $TERM in windows Review URL: http://codereview.chromium.org/6686027 TBR=mhm@chromium.org Review URL: http://codereview.chromium.org/6683033 git-svn-id: svn://svn.chromium.org/chrome/trunk/tools/depot_tools@77972 0039d316-1c4b-4281-b951-d872f2087c98 --- gcl.py | 5 +++-- git_cl/git_cl.py | 5 +++-- 2 files changed, 6 insertions(+), 4 deletions(-) diff --git a/gcl.py b/gcl.py index 775a78083..ce259bcfa 100755 --- a/gcl.py +++ b/gcl.py @@ -1065,8 +1065,9 @@ def CMDchange(args): # Open up the default editor in the system to get the CL description. cmd = [GetEditor(), filename] - if sys.platform == 'win32' and os.environ['TERM'] == 'msys': - # Msysgit requires the usage of 'env' to be present. + 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: if not silent: diff --git a/git_cl/git_cl.py b/git_cl/git_cl.py index 0c50651ad..3b7ca3342 100644 --- a/git_cl/git_cl.py +++ b/git_cl/git_cl.py @@ -712,8 +712,9 @@ 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 os.environ['TERM'] == 'msys': - # Msysgit requires the usage of 'env' to be present. + 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(cmd)