##// END OF EJS Templates
stream-clone: factor computation of new clone requirement out...
marmoute -
r49442:739f2ca3 default
parent child Browse files
Show More
@@ -32,6 +32,21 b' from .utils import ('
32 )
32 )
33
33
34
34
35 def new_stream_clone_requirements(
36 supported_formats, default_requirements, streamed_requirements
37 ):
38 """determine the final set of requirement for a new stream clone
39
40 this method combine the "default" requirements that a new repository would
41 use with the constaint we get from the stream clone content. We keep local
42 configuration choice when possible.
43 """
44 requirements = set(default_requirements)
45 requirements -= supported_formats
46 requirements.update(streamed_requirements)
47 return requirements
48
49
35 def canperformstreamclone(pullop, bundle2=False):
50 def canperformstreamclone(pullop, bundle2=False):
36 """Whether it is possible to perform a streaming clone as part of pull.
51 """Whether it is possible to perform a streaming clone as part of pull.
37
52
@@ -184,12 +199,10 b' def maybeperformlegacystreamclone(pullop'
184
199
185 with repo.lock():
200 with repo.lock():
186 consumev1(repo, fp, filecount, bytecount)
201 consumev1(repo, fp, filecount, bytecount)
187
202 repo.requirements = new_stream_clone_requirements(
188 # new requirements = old non-format requirements +
203 repo.supportedformats,
189 # new format-related remote requirements
204 repo.requirements,
190 # requirements from the streamed-in repository
205 requirements,
191 repo.requirements = requirements | (
192 repo.requirements - repo.supportedformats
193 )
206 )
194 repo.svfs.options = localrepo.resolvestorevfsoptions(
207 repo.svfs.options = localrepo.resolvestorevfsoptions(
195 repo.ui, repo.requirements, repo.features
208 repo.ui, repo.requirements, repo.features
@@ -797,11 +810,10 b' def applybundlev2(repo, fp, filecount, f'
797
810
798 consumev2(repo, fp, filecount, filesize)
811 consumev2(repo, fp, filecount, filesize)
799
812
800 # new requirements = old non-format requirements +
813 repo.requirements = new_stream_clone_requirements(
801 # new format-related remote requirements
814 repo.supportedformats,
802 # requirements from the streamed-in repository
815 repo.requirements,
803 repo.requirements = set(requirements) | (
816 requirements,
804 repo.requirements - repo.supportedformats
805 )
817 )
806 repo.svfs.options = localrepo.resolvestorevfsoptions(
818 repo.svfs.options = localrepo.resolvestorevfsoptions(
807 repo.ui, repo.requirements, repo.features
819 repo.ui, repo.requirements, repo.features
General Comments 0
You need to be logged in to leave comments. Login now