Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(167)

Unified Diff: git_map_branches.py

Issue 1893563002: Use CLs more consistently instead of branch names (Closed) Base URL: https://chromium.googlesource.com/chromium/tools/depot_tools.git@master
Patch Set: last changes Created 4 years, 7 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View side-by-side diff with in-line comments
Download patch
« no previous file with comments | « git_cl.py ('k') | no next file » | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: git_map_branches.py
diff --git a/git_map_branches.py b/git_map_branches.py
index 016a0330f732a9e76286c79fdea08ef4ed10ec33..f5951699d7fba0ef8e24bad08ff3984522571fe0 100755
--- a/git_map_branches.py
+++ b/git_map_branches.py
@@ -128,17 +128,19 @@ 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, color_for_status
+ from git_cl import get_cl_statuses, color_for_status, Changelist
- status_info = get_cl_statuses(self.__branches_info.keys(),
+ change_cls = [Changelist(branchref='refs/heads/'+b)
+ for b in self.__branches_info.keys() if b]
+ status_info = get_cl_statuses(change_cls,
fine_grained=self.verbosity > 2,
max_processes=self.maxjobs)
- for _ in xrange(len(self.__branches_info)):
- # This is a blocking get which waits for the remote CL status to be
- # retrieved.
- (branch, url, status) = status_info.next()
- self.__status_info[branch] = (url, color_for_status(status))
+ # This is a blocking get which waits for the remote CL status to be
+ # retrieved.
+ for cl, status in status_info:
+ self.__status_info[cl.GetBranch()] = (cl.GetIssueURL(),
+ color_for_status(status))
roots = set()
@@ -258,9 +260,9 @@ class BranchMapper(object):
# The Rietveld issue associated with the branch.
if self.verbosity >= 2:
- none_text = '' if self.__is_invalid_parent(branch) else 'None'
- (url, color) = self.__status_info[branch]
- line.append(url or none_text, color=color)
+ (url, color) = ('', '') if self.__is_invalid_parent(branch) \
+ else self.__status_info[branch]
+ line.append(url or '', color=color)
# The subject of the most recent commit on the branch.
if self.show_subject:
« no previous file with comments | « git_cl.py ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698