[Updated] D12028: stream-clone: factor computation of requirement of a stream clone
marmoute (Pierre-Yves David)
phabricator at mercurial-scm.org
Tue Jan 25 09:15:37 UTC 2022
Closed by commit rHG8475a1364909: stream-clone: factor computation of requirement of a stream clone (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/D12028?vs=31728&id=31904
CHANGES SINCE LAST ACTION
https://phab.mercurial-scm.org/D12028/new/
REVISION DETAIL
https://phab.mercurial-scm.org/D12028
AFFECTED FILES
mercurial/streamclone.py
mercurial/wireprotov1server.py
CHANGE DETAILS
diff --git a/mercurial/wireprotov1server.py b/mercurial/wireprotov1server.py
--- a/mercurial/wireprotov1server.py
+++ b/mercurial/wireprotov1server.py
@@ -300,7 +300,7 @@
if streamclone.allowservergeneration(repo):
if repo.ui.configbool(b'server', b'preferuncompressed'):
caps.append(b'stream-preferred')
- requiredformats = repo.requirements & repo.supportedformats
+ requiredformats = streamclone.streamed_requirements(repo)
# if our local revlogs are just revlogv1, add 'stream' cap
if not requiredformats - {requirementsmod.REVLOGV1_REQUIREMENT}:
caps.append(b'stream')
diff --git a/mercurial/streamclone.py b/mercurial/streamclone.py
--- a/mercurial/streamclone.py
+++ b/mercurial/streamclone.py
@@ -47,6 +47,15 @@
return requirements
+def streamed_requirements(repo):
+ """the set of requirement the new clone will have to support
+
+ This is used for advertising the stream options and to generate the actual
+ stream content."""
+ requiredformats = repo.requirements & repo.supportedformats
+ return requiredformats
+
+
def canperformstreamclone(pullop, bundle2=False):
"""Whether it is possible to perform a streaming clone as part of pull.
@@ -346,7 +355,7 @@
if compression != b'UN':
raise ValueError(b'we do not support the compression argument yet')
- requirements = repo.requirements & repo.supportedformats
+ requirements = streamed_requirements(repo)
requires = b','.join(sorted(requirements))
def gen():
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/701a56e6/attachment-0002.html>
More information about the Mercurial-patches
mailing list