mirror of
https://github.com/facebook/sapling.git
synced 2024-10-11 09:17:30 +03:00
1030d2b7e5
Summary: This is unnecessary after the recent modifications in the namespace code. Reviewed By: quark-zju Differential Revision: D9815973 fbshipit-source-id: d7c6b07226be35ebbbe5354d5c520c9807cc0aa6
24 lines
632 B
Python
24 lines
632 B
Python
# Dummy extension to define a namespace containing revision names
|
|
|
|
from __future__ import absolute_import
|
|
|
|
from mercurial import namespaces, registrar
|
|
|
|
|
|
namespacepredicate = registrar.namespacepredicate()
|
|
|
|
|
|
@namespacepredicate("revnames", priority=70)
|
|
def _revnamelookup(repo):
|
|
names = {"r%d" % rev: repo[rev].node() for rev in repo}
|
|
namemap = lambda r, name: names.get(name)
|
|
nodemap = lambda r, node: ["r%d" % repo[node].rev()]
|
|
|
|
return namespaces.namespace(
|
|
templatename="revname",
|
|
logname="revname",
|
|
listnames=lambda r: names.keys(),
|
|
namemap=namemap,
|
|
nodemap=nodemap,
|
|
)
|