comparison mercurial/streamclone.py @ 46665:ee91966aec0f

requirements: add constant for revlog v1 requirement Since this series is adding a new requirement, we might as well clean up while we're here. Differential Revision: https://phab.mercurial-scm.org/D10105
author Rapha?l Gom?s <rgomes@octobus.net>
date Wed, 03 Mar 2021 14:00:45 +0100
parents a03c177a4679
children 6085b7f1536d
comparison
equal deleted inserted replaced
46664:3941fe53670d 46665:ee91966aec0f
18 cacheutil, 18 cacheutil,
19 error, 19 error,
20 narrowspec, 20 narrowspec,
21 phases, 21 phases,
22 pycompat, 22 pycompat,
23 requirements as requirementsmod,
23 scmutil, 24 scmutil,
24 store, 25 store,
25 util, 26 util,
26 ) 27 )
27 28
81 # capability. "stream" (a value-less capability) is advertised if and only 82 # capability. "stream" (a value-less capability) is advertised if and only
82 # if the only requirement is "revlogv1." Else, the "streamreqs" capability 83 # if the only requirement is "revlogv1." Else, the "streamreqs" capability
83 # is advertised and contains a comma-delimited list of requirements. 84 # is advertised and contains a comma-delimited list of requirements.
84 requirements = set() 85 requirements = set()
85 if remote.capable(b'stream'): 86 if remote.capable(b'stream'):
86 requirements.add(b'revlogv1') 87 requirements.add(requirementsmod.REVLOGV1_REQUIREMENT)
87 else: 88 else:
88 streamreqs = remote.capable(b'streamreqs') 89 streamreqs = remote.capable(b'streamreqs')
89 # This is weird and shouldn't happen with modern servers. 90 # This is weird and shouldn't happen with modern servers.
90 if not streamreqs: 91 if not streamreqs:
91 pullop.repo.ui.warn( 92 pullop.repo.ui.warn(