[PATCH 09 of 12] debuglabelcomplete: use labels instead of hardcoding tags and bookmarks
Sean Farley
sean.michael.farley at gmail.com
Mon Aug 18 21:18:05 UTC 2014
# HG changeset patch
# User Sean Farley <sean.michael.farley at gmail.com>
# Date 1396319547 18000
# Mon Mar 31 21:32:27 2014 -0500
# Node ID 186ccd3d9042c0c5ec8cb9b9b4d58a7386ea1c65
# Parent 5e3722e0076cc2a3c92758ff762e2916ce05e569
debuglabelcomplete: use labels instead of hardcoding tags and bookmarks
This allows bash completion for arbitrary labels.
diff --git a/mercurial/commands.py b/mercurial/commands.py
--- a/mercurial/commands.py
+++ b/mercurial/commands.py
@@ -2293,12 +2293,12 @@ def debugknown(ui, repopath, *ids, **opt
@command('debuglabelcomplete', [], _('LABEL...'))
def debuglabelcomplete(ui, repo, *args):
'''complete "labels" - tags, open branch names, bookmark names'''
labels = set()
- labels.update(t[0] for t in repo.tagslist())
- labels.update(repo._bookmarks.keys())
+ for namespace, l in repo.alllabels().iteritems():
+ labels.update(name for name, node in l.iteritems())
labels.update(tag for (tag, heads, tip, closed)
in repo.branchmap().iterbranches() if not closed)
completions = set()
if not args:
args = ['']
More information about the Mercurial-devel
mailing list