Patchwork [08,of,12] debuglabelcomplete: simplify with repo.branchmap().iterbranches()

login
register
mail settings
Submitter Brodie Rao
Date Nov. 16, 2013, 2:27 a.m.
Message ID <0c14108b4c7ed4317b71.1384568860@hit-nxdomain.opendns.com>
Download mbox | patch
Permalink /patch/2966/
State Superseded
Headers show

Comments

Brodie Rao - Nov. 16, 2013, 2:27 a.m.
# HG changeset patch
# User Brodie Rao <brodie@sf.io>
# Date 1379318909 25200
#      Mon Sep 16 01:08:29 2013 -0700
# Node ID 0c14108b4c7ed4317b71f0f54b5bbc98a7c38558
# Parent  8b79a928000fbf6f28fd72a48b1b066721aaf3d7
debuglabelcomplete: simplify with repo.branchmap().iterbranches()

Patch

diff --git a/mercurial/commands.py b/mercurial/commands.py
--- a/mercurial/commands.py
+++ b/mercurial/commands.py
@@ -2138,11 +2138,8 @@  def debuglabelcomplete(ui, repo, *args):
     labels = set()
     labels.update(t[0] for t in repo.tagslist())
     labels.update(repo._bookmarks.keys())
-    for heads in repo.branchmap().itervalues():
-        for h in heads:
-            ctx = repo[h]
-            if not ctx.closesbranch():
-                labels.add(ctx.branch())
+    labels.update(tag for (tag, heads, tip, closed)
+                  in repo.branchmap().iterbranches() if not closed)
     completions = set()
     if not args:
         args = ['']