Comments
Patch
@@ -17,21 +17,24 @@ from . import (
def _nslist(repo):
n = {}
for k in _namespaces:
n[k] = ""
if not obsolete.isenabled(repo, obsolete.exchangeopt):
n.pop('obsolete')
return n
-_namespaces = {"namespaces": (lambda *x: False, _nslist),
- "bookmarks": (bookmarks.pushbookmark, bookmarks.listbookmarks),
- "phases": (phases.pushphase, phases.listphases),
- "obsolete": (obsolete.pushmarker, obsolete.listmarkers),
- }
+# Maps pushkey namespace to a tuple defining functions to call for
+# setting and listing entries in the namespace.
+_namespaces = {
+ 'namespaces': (lambda *x: False, _nslist),
+ 'bookmarks': (bookmarks.pushbookmark, bookmarks.listbookmarks),
+ 'phases': (phases.pushphase, phases.listphases),
+ 'obsolete': (obsolete.pushmarker, obsolete.listmarkers),
+}
def register(namespace, pushkey, listkeys):
_namespaces[namespace] = (pushkey, listkeys)
def _get(namespace):
return _namespaces.get(namespace, (lambda *x: False, lambda *x: {}))
def push(repo, namespace, key, old, new):