Comments
Patch
@@ -32,9 +32,7 @@
)
-def new_stream_clone_requirements(
- supported_formats, default_requirements, streamed_requirements
-):
+def new_stream_clone_requirements(default_requirements, streamed_requirements):
"""determine the final set of requirement for a new stream clone
this method combine the "default" requirements that a new repository would
@@ -42,7 +40,7 @@
configuration choice when possible.
"""
requirements = set(default_requirements)
- requirements -= supported_formats
+ requirements -= requirementsmod.STREAM_FIXED_REQUIREMENTS
requirements.update(streamed_requirements)
return requirements
@@ -52,7 +50,9 @@
This is used for advertising the stream options and to generate the actual
stream content."""
- requiredformats = repo.requirements & repo.supportedformats
+ requiredformats = (
+ repo.requirements & requirementsmod.STREAM_FIXED_REQUIREMENTS
+ )
return requiredformats
@@ -209,7 +209,6 @@
with repo.lock():
consumev1(repo, fp, filecount, bytecount)
repo.requirements = new_stream_clone_requirements(
- repo.supportedformats,
repo.requirements,
requirements,
)
@@ -820,7 +819,6 @@
consumev2(repo, fp, filecount, filesize)
repo.requirements = new_stream_clone_requirements(
- repo.supportedformats,
repo.requirements,
requirements,
)
@@ -89,3 +89,23 @@
SHARESAFE_REQUIREMENT,
DIRSTATE_V2_REQUIREMENT,
}
+
+# List of requirement that impact "stream-clone" (and hardlink clone) and
+# cannot be changed in such cache.
+#
+# requirements not in this list are safe to be altered during stream-clone.
+#
+# note: the list is currently inherited from previous code and miss some relevant requirement while containing some irrelevant ones.
+STREAM_FIXED_REQUIREMENTS = {
+ BOOKMARKS_IN_STORE_REQUIREMENT,
+ CHANGELOGV2_REQUIREMENT,
+ COPIESSDC_REQUIREMENT,
+ DIRSTATE_V2_REQUIREMENT,
+ GENERALDELTA_REQUIREMENT,
+ NODEMAP_REQUIREMENT,
+ REVLOGV1_REQUIREMENT,
+ REVLOGV2_REQUIREMENT,
+ SHARESAFE_REQUIREMENT,
+ SPARSEREVLOG_REQUIREMENT,
+ TREEMANIFEST_REQUIREMENT,
+}
@@ -195,7 +195,7 @@
# repo supports and error if the bundle isn't compatible.
if version == b'packed1' and b'requirements' in params:
requirements = set(params[b'requirements'].split(b','))
- missingreqs = requirements - repo.supportedformats
+ missingreqs = requirements - requirementsmod.STREAM_FIXED_REQUIREMENTS
if missingreqs:
raise error.UnsupportedBundleSpecification(
_(b'missing support for repository features: %s')