Commit eceda5af authored by mhm@chromium.org's avatar mhm@chromium.org

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

git-svn-id: svn://svn.chromium.org/chrome/trunk/tools/depot_tools@77954 0039d316-1c4b-4281-b951-d872f2087c98
parent 1edee691
......@@ -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['TERM'] == 'msys':
# Msysgit requires the usage of 'env' to be present.
cmd.insert(0, 'env')
try:
if not silent:
......
......@@ -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['TERM'] == 'msys':
# Msysgit requires the usage of 'env' to be present.
cmd.insert(0, 'env')
try:
subprocess.check_call(cmd)
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment