[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
diff --git a/git_map_branches.py b/git_map_branches.py
index f595169..c00dcb9 100755
--- a/git_map_branches.py
+++ b/git_map_branches.py
@@ -140,7 +140,8 @@
# 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 @@
# 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: