diff --git a/mercurial/namespaces.py b/mercurial/namespaces.py --- a/mercurial/namespaces.py +++ b/mercurial/namespaces.py @@ -41,7 +41,8 @@ class namespaces(object): # i18n: column positioning for "hg log" logfmt=_("tag: %s\n"), listnames=tagnames, - namemap=tagnamemap, nodemap=tagnodemap) + namemap=tagnamemap, nodemap=tagnodemap, + deprecated=set(['tip'])) self.addnamespace(n) bnames = lambda repo: repo.branchmap().keys() @@ -126,11 +127,13 @@ class namespace(object): dictionary) 'namemap': function that takes a name and returns a list of nodes 'nodemap': function that takes a node and returns a list of names + 'deprecated': set of names to be masked for ordinary use """ def __init__(self, name, templatename=None, logname=None, colorname=None, - logfmt=None, listnames=None, namemap=None, nodemap=None): + logfmt=None, listnames=None, namemap=None, nodemap=None, + deprecated=None): """create a namespace name: the namespace to be registered (in plural form) @@ -144,6 +147,7 @@ class namespace(object): listnames: function to list all names namemap: function that inputs a node, output name(s) nodemap: function that inputs a name, output node(s) + deprecated: set of names to be masked for ordinary use """ self.name = name @@ -168,6 +172,11 @@ class namespace(object): # i18n: column positioning for "hg log" self.logfmt = ("%s:" % self.logname).ljust(13) + "%s\n" + if deprecated is None: + self.deprecated = set() + else: + self.deprecated = deprecated + def names(self, repo, node): """method that returns a (sorted) list of names in a namespace that match a given node""" diff --git a/mercurial/revset.py b/mercurial/revset.py --- a/mercurial/revset.py +++ b/mercurial/revset.py @@ -1277,7 +1277,8 @@ def named(repo, subset, x): names = set() for ns in namespaces: for name in ns.listnames(repo): - names.update(repo[n].rev() for n in ns.nodes(repo, name)) + if name not in ns.deprecated: + names.update(repo[n].rev() for n in ns.nodes(repo, name)) names -= set([node.nullrev]) return subset & names diff --git a/tests/test-revset.t b/tests/test-revset.t --- a/tests/test-revset.t +++ b/tests/test-revset.t @@ -791,7 +791,6 @@ we can use patterns when searching for t 6 $ log 'named("tags")' 6 - 9 issue2437