diff mercurial/namespaces.py @ 44728:59ad165f6cdb

templatekw: fix shownames() to check if namespace exists in repo (issue6301) Namespace registration is dynamic, but the corresponding template keyword is registered statically.
author Yuya Nishihara <yuya@tcha.org>
date Thu, 16 Apr 2020 22:30:11 +0900
parents d783f945a701
children 6000f5b25c9b
line wrap: on
line diff
--- a/mercurial/namespaces.py	Wed Apr 15 20:10:35 2020 +0200
+++ b/mercurial/namespaces.py	Thu Apr 16 22:30:11 2020 +0900
@@ -83,6 +83,9 @@
     def __iter__(self):
         return self._names.__iter__()
 
+    def get(self, namespace, default=None):
+        return self._names.get(namespace, default)
+
     def items(self):
         return pycompat.iteritems(self._names)