Commit 885f6519 authored by maruel@chromium.org's avatar maruel@chromium.org

Disable colors if not a tty.

Otherwise this breaks git cl unit tests.

Update references to 'git cl' in git cl smoke tests to $GIT_CL.

TBR=ilevy@chromium.org
BUG=

Review URL: https://chromiumcodereview.appspot.com/20888002

git-svn-id: svn://svn.chromium.org/chrome/trunk/tools/depot_tools@214019 0039d316-1c4b-4281-b951-d872f2087c98
parent d9c1b200
...@@ -1169,8 +1169,12 @@ def CMDstatus(parser, args): ...@@ -1169,8 +1169,12 @@ def CMDstatus(parser, args):
b, i, color = output.get() b, i, color = output.get()
tmp[b] = (i, color) tmp[b] = (i, color)
issue, color = tmp.pop(branch) issue, color = tmp.pop(branch)
reset = Fore.RESET
if not sys.stdout.isatty():
color = ''
reset = ''
print ' %*s: %s%s%s' % ( print ' %*s: %s%s%s' % (
alignment, ShortBranchName(branch), color, issue, Fore.RESET) alignment, ShortBranchName(branch), color, issue, reset)
cl = Changelist() cl = Changelist()
print print
......
...@@ -54,7 +54,7 @@ setup_gitsvn ...@@ -54,7 +54,7 @@ setup_gitsvn
"git show | grep -q 'foo-quux'" "git show | grep -q 'foo-quux'"
test_expect_success "issue no longer has a branch" \ test_expect_success "issue no longer has a branch" \
"git cl status | grep -q 'work: None'" "$GIT_CL status | grep -q 'work: None'"
test_expect_success "upstream svn has our commit" \ test_expect_success "upstream svn has our commit" \
"svn log $REPO_URL 2>/dev/null | grep -q 'foo-quux'" "svn log $REPO_URL 2>/dev/null | grep -q 'foo-quux'"
......
...@@ -33,7 +33,7 @@ setup_gitsvn ...@@ -33,7 +33,7 @@ setup_gitsvn
git checkout -q -b test2 master git checkout -q -b test2 master
test_expect_success "git cl patch $ISSUE" test_expect_success "$GIT_CL patch $ISSUE"
) )
SUCCESS=$? SUCCESS=$?
......
...@@ -57,7 +57,7 @@ setup_gitgit ...@@ -57,7 +57,7 @@ setup_gitgit
"git show | grep -q 'foo-quux'" "git show | grep -q 'foo-quux'"
test_expect_success "issue no longer has a branch" \ test_expect_success "issue no longer has a branch" \
"git cl status | grep -q 'work: None'" "$GIT_CL status | grep -q 'work: None'"
cd $GITREPO_PATH cd $GITREPO_PATH
test_expect_success "upstream repo has our commit" \ test_expect_success "upstream repo has our commit" \
......
...@@ -56,7 +56,7 @@ setup_gitgit ...@@ -56,7 +56,7 @@ setup_gitgit
"git show | [ $( egrep -q '^branch work$' -c ) -eq 2 ] "git show | [ $( egrep -q '^branch work$' -c ) -eq 2 ]
test_expect_success "issue no longer has a branch" \ test_expect_success "issue no longer has a branch" \
"git cl status | grep -q 'work: None'" "$GIT_CL status | grep -q 'work: None'"
cd $GITREPO_PATH cd $GITREPO_PATH
test_expect_success "upstream repo has our commit" \ test_expect_success "upstream repo has our commit" \
......
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