Fix coloring madness in depot_tools.

'setup_color' now contains logic to correctly detect:
  * cmd
  * cmd pipe
  * msys bash
  * msys pipe
  * cmd running inside msys bash (git-command)
  * cmd pipe running inside msys bash (git-command > outfile)

R=brucedawson@chromium.org, dnj@chromium.org
BUG=600049

Review URL: https://codereview.chromium.org/1851283002

git-svn-id: svn://svn.chromium.org/chrome/trunk/tools/depot_tools@299682 0039d316-1c4b-4281-b951-d872f2087c98
diff --git a/git_map_branches.py b/git_map_branches.py
index 50b403d..016a033 100755
--- a/git_map_branches.py
+++ b/git_map_branches.py
@@ -28,16 +28,17 @@
 import argparse
 import collections
 import os
-import sys
 import subprocess2
-
-from third_party import colorama
-from third_party.colorama import Fore, Style
+import sys
 
 from git_common import current_branch, upstream, tags, get_branches_info
 from git_common import get_git_version, MIN_UPSTREAM_TRACK_GIT_VERSION, hash_one
 from git_common import run
 
+import setup_color
+
+from third_party.colorama import Fore, Style
+
 DEFAULT_SEPARATOR = ' ' * 4
 
 
@@ -272,7 +273,7 @@
 
 
 def main(argv):
-  colorama.init(wrap="TERM" not in os.environ)
+  setup_color.init()
   if get_git_version() < MIN_UPSTREAM_TRACK_GIT_VERSION:
     print >> sys.stderr, (
         'This tool will not show all tracking information for git version '