Patchwork [09,of,13,V2] debuglabelcomplete: simplify with repo.branchmap().iterbranches()

login
register
mail settings
Submitter Brodie Rao
Date Nov. 16, 2013, 4:18 a.m.
Message ID <1774ee4b53e032815ae1.1384575533@hit-nxdomain.opendns.com>
Download mbox | patch
Permalink /patch/2985/
State Accepted
Commit cbe2bcc927cd0f106d8bc78bc9575cacc3ef3225
Headers show

Comments

Brodie Rao - Nov. 16, 2013, 4:18 a.m.
# HG changeset patch
# User Brodie Rao <brodie@sf.io>
# Date 1379318909 25200
#      Mon Sep 16 01:08:29 2013 -0700
# Node ID 1774ee4b53e032815ae1d37a30f0d5a90a8a9f32
# Parent  d0b73a908d4aefd10bde5800d27316806de47f8e
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 = ['']