##// END OF EJS Templates
remotefilelog: rename capability for legacy ssh file fetching method...
Augie Fackler -
r40543:354acd0d default
parent child Browse files
Show More
@@ -114,6 +114,7 b' from mercurial import ('
114 util,
114 util,
115 )
115 )
116 from . import (
116 from . import (
117 constants,
117 debugcommands,
118 debugcommands,
118 fileserverclient,
119 fileserverclient,
119 remotefilectx,
120 remotefilectx,
@@ -282,7 +283,7 b' def cloneshallow(orig, ui, repo, *args, '
282 # patterns.
283 # patterns.
283 def stream_out_shallow(orig):
284 def stream_out_shallow(orig):
284 caps = remote.capabilities()
285 caps = remote.capabilities()
285 if shallowrepo.requirement in caps:
286 if constants.NETWORK_CAP_LEGACY_SSH_GETFILES in caps:
286 opts = {}
287 opts = {}
287 if repo.includepattern:
288 if repo.includepattern:
288 opts['includepattern'] = '\0'.join(repo.includepattern)
289 opts['includepattern'] = '\0'.join(repo.includepattern)
@@ -6,6 +6,8 b' from mercurial.i18n import _'
6
6
7 REQUIREMENT = "remotefilelog"
7 REQUIREMENT = "remotefilelog"
8
8
9 NETWORK_CAP_LEGACY_SSH_GETFILES = 'exp-remotefilelog-ssh-getfiles-1'
10
9 FILENAMESTRUCT = '!H'
11 FILENAMESTRUCT = '!H'
10 FILENAMESIZE = struct.calcsize(FILENAMESTRUCT)
12 FILENAMESIZE = struct.calcsize(FILENAMESTRUCT)
11
13
@@ -78,7 +78,8 b' def peersetup(ui, peer):'
78 def _updatecallstreamopts(self, command, opts):
78 def _updatecallstreamopts(self, command, opts):
79 if command != 'getbundle':
79 if command != 'getbundle':
80 return
80 return
81 if 'remotefilelog' not in self.capabilities():
81 if (constants.NETWORK_CAP_LEGACY_SSH_GETFILES
82 not in self.capabilities()):
82 return
83 return
83 if not util.safehasattr(self, '_localrepo'):
84 if not util.safehasattr(self, '_localrepo'):
84 return
85 return
@@ -377,9 +378,8 b' class fileserverclient(object):'
377 try:
378 try:
378 with self._connect() as conn:
379 with self._connect() as conn:
379 remote = conn.peer
380 remote = conn.peer
380 # TODO: deduplicate this with the constant in
381 if remote.capable(
381 # shallowrepo
382 constants.NETWORK_CAP_LEGACY_SSH_GETFILES):
382 if remote.capable("remotefilelog"):
383 if not isinstance(remote, _sshv1peer):
383 if not isinstance(remote, _sshv1peer):
384 raise error.Abort('remotefilelog requires ssh '
384 raise error.Abort('remotefilelog requires ssh '
385 'servers')
385 'servers')
@@ -29,6 +29,7 b' from mercurial import ('
29 wireprotov1server,
29 wireprotov1server,
30 )
30 )
31 from . import (
31 from . import (
32 constants,
32 shallowrepo,
33 shallowrepo,
33 shallowutil,
34 shallowutil,
34 )
35 )
@@ -197,7 +198,7 b' def onetimesetup(ui):'
197 ui.configbool('remotefilelog', 'server'))):
198 ui.configbool('remotefilelog', 'server'))):
198 if isinstance(proto, _sshv1server):
199 if isinstance(proto, _sshv1server):
199 # legacy getfiles method which only works over ssh
200 # legacy getfiles method which only works over ssh
200 caps.append(shallowrepo.requirement)
201 caps.append(constants.NETWORK_CAP_LEGACY_SSH_GETFILES)
201 caps.append('getflogheads')
202 caps.append('getflogheads')
202 caps.append('getfile')
203 caps.append('getfile')
203 return caps
204 return caps
@@ -36,13 +36,13 b' the server supports our custom getfiles '
36
36
37 $ cd master
37 $ cd master
38 $ echo 'hello' | hg -R . serve --stdio | grep capa | identifyrflcaps
38 $ echo 'hello' | hg -R . serve --stdio | grep capa | identifyrflcaps
39 exp-remotefilelog-ssh-getfiles-1
39 getfile
40 getfile
40 getflogheads
41 getflogheads
41 remotefilelog
42 $ echo 'capabilities' | hg -R . serve --stdio | identifyrflcaps ; echo
42 $ echo 'capabilities' | hg -R . serve --stdio | identifyrflcaps ; echo
43 exp-remotefilelog-ssh-getfiles-1
43 getfile
44 getfile
44 getflogheads
45 getflogheads
45 remotefilelog
46
46
47
47
48 Pull to the child repository. Use our custom setupremotefilelog extension
48 Pull to the child repository. Use our custom setupremotefilelog extension
@@ -23,13 +23,13 b' the server supports our custom getfiles '
23
23
24 $ cd master
24 $ cd master
25 $ echo 'hello' | hg -R . serve --stdio | grep capa | identifyrflcaps
25 $ echo 'hello' | hg -R . serve --stdio | grep capa | identifyrflcaps
26 exp-remotefilelog-ssh-getfiles-1
26 getfile
27 getfile
27 getflogheads
28 getflogheads
28 remotefilelog
29 $ echo 'capabilities' | hg -R . serve --stdio | identifyrflcaps ; echo
29 $ echo 'capabilities' | hg -R . serve --stdio | identifyrflcaps ; echo
30 exp-remotefilelog-ssh-getfiles-1
30 getfile
31 getfile
31 getflogheads
32 getflogheads
32 remotefilelog
33
33
34 # pull to shallow from full
34 # pull to shallow from full
35
35
General Comments 0
You need to be logged in to leave comments. Login now