Fix "git cl map-branches -vvv"

CL https://codereview.chromium.org/1172223002 changed the meaning of the
third value in the tuple returned by get_cl_statuses from a color to the
status of the branch and broke the formatting of output.

Convert the status to the color using color_for_status helper function.

BUG=499189

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

git-svn-id: svn://svn.chromium.org/chrome/trunk/tools/depot_tools@295618 0039d316-1c4b-4281-b951-d872f2087c98
parent 5a447764
......@@ -126,7 +126,7 @@ class BranchMapper(object):
include_tracking_status=self.verbosity >= 1)
if (self.verbosity >= 2):
# Avoid heavy import unless necessary.
from git_cl import get_cl_statuses
from git_cl import get_cl_statuses, color_for_status
status_info = get_cl_statuses(self.__branches_info.keys(),
fine_grained=self.verbosity > 2,
......@@ -135,8 +135,8 @@ class BranchMapper(object):
for _ in xrange(len(self.__branches_info)):
# This is a blocking get which waits for the remote CL status to be
# retrieved.
(branch, url, color) = status_info.next()
self.__status_info[branch] = (url, color);
(branch, url, status) = status_info.next()
self.__status_info[branch] = (url, color_for_status(status))
roots = set()
......
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