[git-map-branches] Show CL status verbatim.

git-map-branches -v -v -v currently indicates the status of the CL using
a color. This change adds the status string alongside the CL to match
the output of 'git-cl status'.

  $ git map-branches -v -v -v

Before:
  A        354ccf6 [ ahead 1 ] https://codereview...
    B      e701150 [ ahead 1 ] https://codereview...
      C *  094cedd [ ahead 1 ] https://codereview...

After:
  A        354ccf6 [ ahead 1 ] https://codereview... (commit)
    B      e701150 [ ahead 1 ] https://codereview... (lgtm)
      C *  094cedd [ ahead 1 ] https://codereview... (waiting)

R=dpranke@chromium.org
BUG=none

Review-Url: https://codereview.chromium.org/2138703003
changes/90/365990/1
asanka 9 years ago committed by Commit bot
parent ae7ea3167e
commit 97f3949a4d

@ -140,7 +140,8 @@ class BranchMapper(object):
# retrieved.
for cl, status in status_info:
self.__status_info[cl.GetBranch()] = (cl.GetIssueURL(),
color_for_status(status))
color_for_status(status),
status)
roots = set()
@ -260,9 +261,12 @@ class BranchMapper(object):
# The Rietveld issue associated with the branch.
if self.verbosity >= 2:
(url, color) = ('', '') if self.__is_invalid_parent(branch) \
else self.__status_info[branch]
line.append(url or '', color=color)
(url, color, status) = ('', '', '') if self.__is_invalid_parent(branch) \
else self.__status_info[branch]
if self.verbosity > 2:
line.append('{} ({})'.format(url, status) if url else '', color=color)
else:
line.append(url or '', color=color)
# The subject of the most recent commit on the branch.
if self.show_subject:

Loading…
Cancel
Save