[Updated] D12027: stream-clone: factor computation of new clone requirement out
marmoute (Pierre-Yves David)
phabricator at mercurial-scm.org
Tue Jan 25 09:15:12 UTC 2022
Closed by commit rHG739f2ca3aa3f: stream-clone: factor computation of new clone requirement out (authored by marmoute).
This revision was automatically updated to reflect the committed changes.
REPOSITORY
rHG Mercurial
CHANGES SINCE LAST UPDATE
https://phab.mercurial-scm.org/D12027?vs=31727&id=31903
CHANGES SINCE LAST ACTION
https://phab.mercurial-scm.org/D12027/new/
REVISION DETAIL
https://phab.mercurial-scm.org/D12027
AFFECTED FILES
mercurial/streamclone.py
CHANGE DETAILS
diff --git a/mercurial/streamclone.py b/mercurial/streamclone.py
--- a/mercurial/streamclone.py
+++ b/mercurial/streamclone.py
@@ -32,6 +32,21 @@
)
+def new_stream_clone_requirements(
+ supported_formats, 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
+ use with the constaint we get from the stream clone content. We keep local
+ configuration choice when possible.
+ """
+ requirements = set(default_requirements)
+ requirements -= supported_formats
+ requirements.update(streamed_requirements)
+ return requirements
+
+
def canperformstreamclone(pullop, bundle2=False):
"""Whether it is possible to perform a streaming clone as part of pull.
@@ -184,12 +199,10 @@
with repo.lock():
consumev1(repo, fp, filecount, bytecount)
-
- # new requirements = old non-format requirements +
- # new format-related remote requirements
- # requirements from the streamed-in repository
- repo.requirements = requirements | (
- repo.requirements - repo.supportedformats
+ repo.requirements = new_stream_clone_requirements(
+ repo.supportedformats,
+ repo.requirements,
+ requirements,
)
repo.svfs.options = localrepo.resolvestorevfsoptions(
repo.ui, repo.requirements, repo.features
@@ -797,11 +810,10 @@
consumev2(repo, fp, filecount, filesize)
- # new requirements = old non-format requirements +
- # new format-related remote requirements
- # requirements from the streamed-in repository
- repo.requirements = set(requirements) | (
- repo.requirements - repo.supportedformats
+ repo.requirements = new_stream_clone_requirements(
+ repo.supportedformats,
+ repo.requirements,
+ requirements,
)
repo.svfs.options = localrepo.resolvestorevfsoptions(
repo.ui, repo.requirements, repo.features
To: marmoute, #hg-reviewers, Alphare
Cc: mercurial-patches
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.mercurial-scm.org/pipermail/mercurial-patches/attachments/20220125/8f0dddb0/attachment-0002.html>
More information about the Mercurial-patches
mailing list