From 97f3949a4d5fcc798b0fc771cef879dae98949af Mon Sep 17 00:00:00 2001 From: asanka Date: Mon, 18 Jul 2016 18:16:40 -0700 Subject: [PATCH] [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 --- git_map_branches.py | 12 ++++++++---- 1 file changed, 8 insertions(+), 4 deletions(-) diff --git a/git_map_branches.py b/git_map_branches.py index f5951699d7..c00dcb95e6 100755 --- a/git_map_branches.py +++ b/git_map_branches.py @@ -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: