# HG changeset patch # User Sean Farley # Date 2014-12-15 22:11:19 # Node ID 7ad155e13f0f51df8e986a0ec4e58ac9a0ccedbb # Parent 0390cc327dd5e35b17bca99c444a3da6e4af079b 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. diff --git a/mercurial/commands.py b/mercurial/commands.py --- a/mercurial/commands.py +++ b/mercurial/commands.py @@ -2352,8 +2352,11 @@ def debugnamecomplete(ui, repo, *args): '''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()