Show More
@@ -962,7 +962,7 b' def exchangepull(orig, repo, remote, *ar' | |||||
962 | **kwargs): |
|
962 | **kwargs): | |
963 | if not bundlecaps: |
|
963 | if not bundlecaps: | |
964 | bundlecaps = set() |
|
964 | bundlecaps = set() | |
965 | bundlecaps.add('remotefilelog') |
|
965 | bundlecaps.add(constants.BUNDLE2_CAPABLITY) | |
966 | return orig(source, heads=heads, common=common, bundlecaps=bundlecaps, |
|
966 | return orig(source, heads=heads, common=common, bundlecaps=bundlecaps, | |
967 | **kwargs) |
|
967 | **kwargs) | |
968 |
|
968 |
@@ -8,6 +8,8 b' REQUIREMENT = "remotefilelog"' | |||||
8 |
|
8 | |||
9 | NETWORK_CAP_LEGACY_SSH_GETFILES = 'exp-remotefilelog-ssh-getfiles-1' |
|
9 | NETWORK_CAP_LEGACY_SSH_GETFILES = 'exp-remotefilelog-ssh-getfiles-1' | |
10 |
|
10 | |||
|
11 | BUNDLE2_CAPABLITY = "exp-remotefilelog-b2cap-1" | |||
|
12 | ||||
11 | FILENAMESTRUCT = '!H' |
|
13 | FILENAMESTRUCT = '!H' | |
12 | FILENAMESIZE = struct.calcsize(FILENAMESTRUCT) |
|
14 | FILENAMESIZE = struct.calcsize(FILENAMESTRUCT) | |
13 |
|
15 |
@@ -99,7 +99,7 b' def peersetup(ui, peer):' | |||||
99 | # getbundle args before it goes across the wire. Once we get rid |
|
99 | # getbundle args before it goes across the wire. Once we get rid | |
100 | # of bundle1, we can use bundle2's _pullbundle2extraprepare to |
|
100 | # of bundle1, we can use bundle2's _pullbundle2extraprepare to | |
101 | # do this more cleanly. |
|
101 | # do this more cleanly. | |
102 |
bundlecaps.append( |
|
102 | bundlecaps.append(constants.BUNDLE2_CAPABLITY) | |
103 | if self._localrepo.includepattern: |
|
103 | if self._localrepo.includepattern: | |
104 | patterns = '\0'.join(self._localrepo.includepattern) |
|
104 | patterns = '\0'.join(self._localrepo.includepattern) | |
105 | includecap = "includepattern=" + patterns |
|
105 | includecap = "includepattern=" + patterns |
@@ -45,7 +45,7 b' def setupserver(ui, repo):' | |||||
45 | def generatefiles(orig, self, changedfiles, linknodes, commonrevs, source, |
|
45 | def generatefiles(orig, self, changedfiles, linknodes, commonrevs, source, | |
46 | *args, **kwargs): |
|
46 | *args, **kwargs): | |
47 | caps = self._bundlecaps or [] |
|
47 | caps = self._bundlecaps or [] | |
48 | if shallowrepo.requirement in caps: |
|
48 | if constants.BUNDLE2_CAPABLITY in caps: | |
49 | # only send files that don't match the specified patterns |
|
49 | # only send files that don't match the specified patterns | |
50 | includepattern = None |
|
50 | includepattern = None | |
51 | excludepattern = None |
|
51 | excludepattern = None | |
@@ -184,7 +184,7 b' def onetimesetup(ui):' | |||||
184 | def getbundleshallow(repo, proto, others): |
|
184 | def getbundleshallow(repo, proto, others): | |
185 | bundlecaps = others.get('bundlecaps', '') |
|
185 | bundlecaps = others.get('bundlecaps', '') | |
186 | bundlecaps = set(bundlecaps.split(',')) |
|
186 | bundlecaps = set(bundlecaps.split(',')) | |
187 | bundlecaps.add('remotefilelog') |
|
187 | bundlecaps.add(constants.BUNDLE2_CAPABLITY) | |
188 | others['bundlecaps'] = ','.join(bundlecaps) |
|
188 | others['bundlecaps'] = ','.join(bundlecaps) | |
189 |
|
189 | |||
190 | return wireprotov1server.commands["getbundle"][0](repo, proto, others) |
|
190 | return wireprotov1server.commands["getbundle"][0](repo, proto, others) |
@@ -17,6 +17,7 b' from mercurial import (' | |||||
17 | pycompat, |
|
17 | pycompat, | |
18 | ) |
|
18 | ) | |
19 | from . import ( |
|
19 | from . import ( | |
|
20 | constants, | |||
20 | remotefilelog, |
|
21 | remotefilelog, | |
21 | shallowutil, |
|
22 | shallowutil, | |
22 | ) |
|
23 | ) | |
@@ -100,7 +101,7 b' class shallowcg1packer(changegroup.cgpac' | |||||
100 |
|
101 | |||
101 | caps = self._bundlecaps or [] |
|
102 | caps = self._bundlecaps or [] | |
102 | if source == "serve" or source == "pull": |
|
103 | if source == "serve" or source == "pull": | |
103 | if 'remotefilelog' in caps: |
|
104 | if constants.BUNDLE2_CAPABLITY in caps: | |
104 | return LocalFiles |
|
105 | return LocalFiles | |
105 | else: |
|
106 | else: | |
106 | # Serving to a full repo requires us to serve everything |
|
107 | # Serving to a full repo requires us to serve everything |
General Comments 0
You need to be logged in to leave comments.
Login now