--- a/mercurial/namespaces.py Sat Jun 24 13:39:20 2017 -0700
+++ b/mercurial/namespaces.py Sat Jun 24 14:52:15 2017 -0700
@@ -35,7 +35,8 @@
# i18n: column positioning for "hg log"
logfmt=_("bookmark: %s\n"),
listnames=bmknames,
- namemap=bmknamemap, nodemap=bmknodemap)
+ namemap=bmknamemap, nodemap=bmknodemap,
+ builtin=True)
self.addnamespace(n)
tagnames = lambda repo: [t for t, n in repo.tagslist()]
@@ -46,7 +47,8 @@
logfmt=_("tag: %s\n"),
listnames=tagnames,
namemap=tagnamemap, nodemap=tagnodemap,
- deprecated={'tip'})
+ deprecated={'tip'},
+ builtin=True)
self.addnamespace(n)
bnames = lambda repo: repo.branchmap().keys()
@@ -56,7 +58,8 @@
# i18n: column positioning for "hg log"
logfmt=_("branch: %s\n"),
listnames=bnames,
- namemap=bnamemap, nodemap=bnodemap)
+ namemap=bnamemap, nodemap=bnodemap,
+ builtin=True)
self.addnamespace(n)
def __getitem__(self, namespace):
@@ -134,12 +137,13 @@
'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
-
+ 'builtin': bool indicating if this namespace is supported by core
+ Mercurial.
"""
def __init__(self, name, templatename=None, logname=None, colorname=None,
logfmt=None, listnames=None, namemap=None, nodemap=None,
- deprecated=None):
+ deprecated=None, builtin=False):
"""create a namespace
name: the namespace to be registered (in plural form)
@@ -154,7 +158,7 @@
namemap: function that inputs a name, output node(s)
nodemap: function that inputs a node, output name(s)
deprecated: set of names to be masked for ordinary use
-
+ builtin: whether namespace is implemented by core Mercurial
"""
self.name = name
self.templatename = templatename
@@ -183,6 +187,8 @@
else:
self.deprecated = deprecated
+ self.builtin = builtin
+
def names(self, repo, node):
"""method that returns a (sorted) list of names in a namespace that
match a given node"""