Mercurial > hg > mercurial-source
changeset 23775:7ad155e13f0f
debugnamecomplete: use new name api
Instead of hardcoding a list of places to check, we use the new repo.names api
to get a list of potential names to complete.
author | Sean Farley <sean.michael.farley@gmail.com> |
---|---|
date | Mon, 15 Dec 2014 14:11:19 -0800 |
parents | 0390cc327dd5 |
children | d486e52352e8 |
files | mercurial/commands.py |
diffstat | 1 files changed, 5 insertions(+), 2 deletions(-) [+] |
line wrap: on
line diff
--- a/mercurial/commands.py +++ b/mercurial/commands.py @@ -2352,8 +2352,11 @@ '''complete "names" - tags, open branch names, bookmark names''' names = set() - names.update(t[0] for t in repo.tagslist()) - names.update(repo._bookmarks.keys()) + # since we previously only listed open branches, we will handle that + # specially (after this for loop) + for name, ns in repo.names.iteritems(): + if name != 'branches': + names.update(ns.listnames(repo)) names.update(tag for (tag, heads, tip, closed) in repo.branchmap().iterbranches() if not closed) completions = set()