##// END OF EJS Templates
httppeer: expose API descriptor on httpv2peer...
httppeer: expose API descriptor on httpv2peer The API descriptor in wireprotov2 is much more expressive than space-delimited tokens and it will be difficult to define methods to query it in all of the ways we'll want to query it. So let's just declare defeat and expose the API descriptor on the peer instance. As part of this, we define a new interface for version 2 peers, fulfilling a TODO in the process. Differential Revision: https://phab.mercurial-scm.org/D4974

File last commit:

r33048:46fa4660 default
r40207:dac438b7 default
Show More
revnamesext.py
18 lines | 619 B | text/x-python | PythonLexer
Gregory Szorc
namespaces: record and expose whether namespace is built-in...
r33048 # Dummy extension to define a namespace containing revision names
from __future__ import absolute_import
from mercurial import (
namespaces,
)
def reposetup(ui, repo):
Yuya Nishihara
py3: mark all string literals in test-command-template.t as bytes...
r36566 names = {b'r%d' % rev: repo[rev].node() for rev in repo}
Gregory Szorc
namespaces: record and expose whether namespace is built-in...
r33048 namemap = lambda r, name: names.get(name)
Yuya Nishihara
py3: mark all string literals in test-command-template.t as bytes...
r36566 nodemap = lambda r, node: [b'r%d' % repo[node].rev()]
Gregory Szorc
namespaces: record and expose whether namespace is built-in...
r33048
Yuya Nishihara
py3: mark all string literals in test-command-template.t as bytes...
r36566 ns = namespaces.namespace(b'revnames', templatename=b'revname',
logname=b'revname',
Gregory Szorc
namespaces: record and expose whether namespace is built-in...
r33048 listnames=lambda r: names.keys(),
namemap=namemap, nodemap=nodemap)
repo.names.addnamespace(ns)