diff mercurial/wireprotov1server.py @ 48619:8475a1364909

stream-clone: factor computation of requirement of a stream clone This gather code duplicated in multiple place and will make it easier to modify it safely in the future. Differential Revision: https://phab.mercurial-scm.org/D12028
author Pierre-Yves David <pierre-yves.david@octobus.net>
date Fri, 14 Jan 2022 18:02:25 +0100
parents 04688c51f81f
children 6000f5b25c9b
line wrap: on
line diff
--- a/mercurial/wireprotov1server.py	Fri Jan 14 17:57:49 2022 +0100
+++ b/mercurial/wireprotov1server.py	Fri Jan 14 18:02:25 2022 +0100
@@ -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')