##// END OF EJS Templates
stream-clone: add a explicit set list requirements relevant to stream clone...
marmoute -
r49447:baddab22 default
parent child Browse files
Show More
@@ -195,7 +195,7 b' def parsebundlespec(repo, spec, strict=T'
195 # repo supports and error if the bundle isn't compatible.
195 # repo supports and error if the bundle isn't compatible.
196 if version == b'packed1' and b'requirements' in params:
196 if version == b'packed1' and b'requirements' in params:
197 requirements = set(params[b'requirements'].split(b','))
197 requirements = set(params[b'requirements'].split(b','))
198 missingreqs = requirements - repo.supportedformats
198 missingreqs = requirements - requirementsmod.STREAM_FIXED_REQUIREMENTS
199 if missingreqs:
199 if missingreqs:
200 raise error.UnsupportedBundleSpecification(
200 raise error.UnsupportedBundleSpecification(
201 _(b'missing support for repository features: %s')
201 _(b'missing support for repository features: %s')
@@ -89,3 +89,23 b' WORKING_DIR_REQUIREMENTS = {'
89 SHARESAFE_REQUIREMENT,
89 SHARESAFE_REQUIREMENT,
90 DIRSTATE_V2_REQUIREMENT,
90 DIRSTATE_V2_REQUIREMENT,
91 }
91 }
92
93 # List of requirement that impact "stream-clone" (and hardlink clone) and
94 # cannot be changed in such cases.
95 #
96 # requirements not in this list are safe to be altered during stream-clone.
97 #
98 # note: the list is currently inherited from previous code and miss some relevant requirement while containing some irrelevant ones.
99 STREAM_FIXED_REQUIREMENTS = {
100 BOOKMARKS_IN_STORE_REQUIREMENT,
101 CHANGELOGV2_REQUIREMENT,
102 COPIESSDC_REQUIREMENT,
103 DIRSTATE_V2_REQUIREMENT,
104 GENERALDELTA_REQUIREMENT,
105 NODEMAP_REQUIREMENT,
106 REVLOGV1_REQUIREMENT,
107 REVLOGV2_REQUIREMENT,
108 SHARESAFE_REQUIREMENT,
109 SPARSEREVLOG_REQUIREMENT,
110 TREEMANIFEST_REQUIREMENT,
111 }
@@ -32,9 +32,7 b' from .utils import ('
32 )
32 )
33
33
34
34
35 def new_stream_clone_requirements(
35 def new_stream_clone_requirements(default_requirements, streamed_requirements):
36 supported_formats, default_requirements, streamed_requirements
37 ):
38 """determine the final set of requirement for a new stream clone
36 """determine the final set of requirement for a new stream clone
39
37
40 this method combine the "default" requirements that a new repository would
38 this method combine the "default" requirements that a new repository would
@@ -42,7 +40,7 b' def new_stream_clone_requirements('
42 configuration choice when possible.
40 configuration choice when possible.
43 """
41 """
44 requirements = set(default_requirements)
42 requirements = set(default_requirements)
45 requirements -= supported_formats
43 requirements -= requirementsmod.STREAM_FIXED_REQUIREMENTS
46 requirements.update(streamed_requirements)
44 requirements.update(streamed_requirements)
47 return requirements
45 return requirements
48
46
@@ -52,7 +50,9 b' def streamed_requirements(repo):'
52
50
53 This is used for advertising the stream options and to generate the actual
51 This is used for advertising the stream options and to generate the actual
54 stream content."""
52 stream content."""
55 requiredformats = repo.requirements & repo.supportedformats
53 requiredformats = (
54 repo.requirements & requirementsmod.STREAM_FIXED_REQUIREMENTS
55 )
56 return requiredformats
56 return requiredformats
57
57
58
58
@@ -209,7 +209,6 b' def maybeperformlegacystreamclone(pullop'
209 with repo.lock():
209 with repo.lock():
210 consumev1(repo, fp, filecount, bytecount)
210 consumev1(repo, fp, filecount, bytecount)
211 repo.requirements = new_stream_clone_requirements(
211 repo.requirements = new_stream_clone_requirements(
212 repo.supportedformats,
213 repo.requirements,
212 repo.requirements,
214 requirements,
213 requirements,
215 )
214 )
@@ -820,7 +819,6 b' def applybundlev2(repo, fp, filecount, f'
820 consumev2(repo, fp, filecount, filesize)
819 consumev2(repo, fp, filecount, filesize)
821
820
822 repo.requirements = new_stream_clone_requirements(
821 repo.requirements = new_stream_clone_requirements(
823 repo.supportedformats,
824 repo.requirements,
822 repo.requirements,
825 requirements,
823 requirements,
826 )
824 )
General Comments 0
You need to be logged in to leave comments. Login now