diff --git a/hgext/remotefilelog/__init__.py b/hgext/remotefilelog/__init__.py --- a/hgext/remotefilelog/__init__.py +++ b/hgext/remotefilelog/__init__.py @@ -961,7 +961,7 @@ **kwargs): if not bundlecaps: bundlecaps = set() - bundlecaps.add('remotefilelog') + bundlecaps.add('x_rfl_remotefilelog') return orig(source, heads=heads, common=common, bundlecaps=bundlecaps, **kwargs) diff --git a/hgext/remotefilelog/fileserverclient.py b/hgext/remotefilelog/fileserverclient.py --- a/hgext/remotefilelog/fileserverclient.py +++ b/hgext/remotefilelog/fileserverclient.py @@ -54,8 +54,8 @@ class remotefilepeer(peer.__class__): @wireprotov1peer.batchable - def getfile(self, file, node): - if not self.capable('getfile'): + def x_rfl_getfile(self, file, node): + if not self.capable('x_rfl_getfile'): raise error.Abort( 'configured remotefile server does not support getfile') f = wireprotov1peer.future() @@ -66,8 +66,8 @@ yield data @wireprotov1peer.batchable - def getflogheads(self, path): - if not self.capable('getflogheads'): + def x_rfl_getflogheads(self, path): + if not self.capable('x_rfl_getflogheads'): raise error.Abort('configured remotefile server does not ' 'support getflogheads') f = wireprotov1peer.future() @@ -202,7 +202,7 @@ with remote.commandexecutor() as e: futures = [] for m in missed: - futures.append(e.callcommand('getfile', { + futures.append(e.callcommand('x_rfl_getfile', { 'file': idmap[m], 'node': m[-40:] })) @@ -217,7 +217,7 @@ def _getfiles_optimistic( remote, receivemissing, progresstick, missed, idmap, step): - remote._callstream("getfiles") + remote._callstream("x_rfl_getfiles") i = 0 pipeo = remote._pipeo pipei = remote._pipei @@ -379,7 +379,7 @@ remote = conn.peer # TODO: deduplicate this with the constant in # shallowrepo - if remote.capable("remotefilelog"): + if remote.capable("x_rfl_remotefilelog"): if not isinstance(remote, _sshv1peer): raise error.Abort('remotefilelog requires ssh ' 'servers') @@ -393,7 +393,7 @@ _getfiles = _getfiles_optimistic _getfiles(remote, self.receivemissing, progresstick, missed, idmap, step) - elif remote.capable("getfile"): + elif remote.capable("x_rfl_getfile"): if remote.capable('batch'): batchdefault = 100 else: diff --git a/hgext/remotefilelog/remotefilelogserver.py b/hgext/remotefilelog/remotefilelogserver.py --- a/hgext/remotefilelog/remotefilelogserver.py +++ b/hgext/remotefilelog/remotefilelogserver.py @@ -77,11 +77,11 @@ # support file content requests wireprotov1server.wireprotocommand( - 'getflogheads', 'path', permission='pull')(getflogheads) + 'x_rfl_getflogheads', 'path', permission='pull')(getflogheads) wireprotov1server.wireprotocommand( - 'getfiles', '', permission='pull')(getfiles) + 'x_rfl_getfiles', '', permission='pull')(getfiles) wireprotov1server.wireprotocommand( - 'getfile', 'file node', permission='pull')(getfile) + 'x_rfl_getfile', 'file node', permission='pull')(getfile) class streamstate(object): match = None @@ -198,8 +198,8 @@ if isinstance(proto, _sshv1server): # legacy getfiles method which only works over ssh caps.append(shallowrepo.requirement) - caps.append('getflogheads') - caps.append('getfile') + caps.append('x_rfl_getflogheads') + caps.append('x_rfl_getfile') return caps extensions.wrapfunction(wireprotov1server, '_capabilities', _capabilities) @@ -215,7 +215,7 @@ context.basefilectx, '_adjustlinkrev', _adjustlinkrev) def _iscmd(orig, cmd): - if cmd == 'getfiles': + if cmd == 'x_rfl_getfiles': return False return orig(cmd) diff --git a/hgext/remotefilelog/shallowbundle.py b/hgext/remotefilelog/shallowbundle.py --- a/hgext/remotefilelog/shallowbundle.py +++ b/hgext/remotefilelog/shallowbundle.py @@ -25,7 +25,7 @@ LocalFiles = 1 AllFiles = 2 -requirement = "remotefilelog" +requirement = "x_rfl_remotefilelog" def shallowgroup(cls, self, nodelist, rlog, lookup, units=None, reorder=None): if not isinstance(rlog, remotefilelog.remotefilelog): diff --git a/hgext/remotefilelog/shallowrepo.py b/hgext/remotefilelog/shallowrepo.py --- a/hgext/remotefilelog/shallowrepo.py +++ b/hgext/remotefilelog/shallowrepo.py @@ -40,7 +40,7 @@ from mercurial.utils import procutil _hgexecutable = procutil.hgexecutable -requirement = "remotefilelog" +requirement = "x_rfl_remotefilelog" _prefetching = _('prefetching') # These make*stores functions are global so that other extensions can replace diff --git a/tests/test-remotefilelog-http.t b/tests/test-remotefilelog-http.t --- a/tests/test-remotefilelog-http.t +++ b/tests/test-remotefilelog-http.t @@ -16,7 +16,7 @@ Build a query string for later use: $ GET=`hg debugdata -m 0 | $PYTHON -c \ - > 'import sys ; print [("?cmd=getfile&file=%s&node=%s" % tuple(s.split("\0"))) for s in sys.stdin.read().splitlines()][0]'` + > 'import sys ; print [("?cmd=x_rfl_getfile&file=%s&node=%s" % tuple(s.split("\0"))) for s in sys.stdin.read().splitlines()][0]'` $ cd .. $ cat hg1.pid >> $DAEMON_PIDS @@ -25,7 +25,7 @@ 2 files fetched over 1 fetches - (2 misses, 0.00% hit ratio) over *s (glob) $ grep getfile access.log - * "GET /?cmd=batch HTTP/1.1" 200 - x-hgarg-1:cmds=getfile+*node%3D1406e74118627694268417491f018a4a883152f0* (glob) + * "GET /?cmd=batch HTTP/1.1" 200 - x-hgarg-1:cmds=x_rfl_getfile+*node%3D1406e74118627694268417491f018a4a883152f0* (glob) Clear filenode cache so we can test fetching with a modified batch size $ rm -r $TESTTMP/hgcache @@ -37,17 +37,17 @@ The 'remotefilelog' capability should *not* be exported over http(s), as the getfile method it offers doesn't work with http. $ get-with-headers.py localhost:$HGPORT '?cmd=capabilities' | grep lookup | identifyrflcaps - getfile - getflogheads + x_rfl_getfile + x_rfl_getflogheads $ get-with-headers.py localhost:$HGPORT '?cmd=hello' | grep lookup | identifyrflcaps - getfile - getflogheads + x_rfl_getfile + x_rfl_getflogheads $ get-with-headers.py localhost:$HGPORT '?cmd=this-command-does-not-exist' | head -n 1 400 no such method: this-command-does-not-exist - $ get-with-headers.py localhost:$HGPORT '?cmd=getfiles' | head -n 1 - 400 no such method: getfiles + $ get-with-headers.py localhost:$HGPORT '?cmd=x_rfl_getfiles' | head -n 1 + 400 no such method: x_rfl_getfiles Verify serving from a shallow clone doesn't allow for remotefile fetches. This also serves to test the error handling for our batchable