comparison mercurial/exchange.py @ 45558:10284ce3d5ed

scmutil: introduce function to check whether repo uses treemanifest or not In an upcoming patch, I wanted to check whether current repo uses treemanifest or not. I looked for a function and found that at all places we manually check for the requirement in repo requirements. I guess having a dedicated function for that is much better. Differential Revision: https://phab.mercurial-scm.org/D8981
author Pulkit Goyal <7895pulkit@gmail.com>
date Tue, 01 Sep 2020 18:08:24 +0530
parents 77b8588dd84e
children a736ab681b78
comparison
equal deleted inserted replaced
45557:4c8d9b53b1c7 45558:10284ce3d5ed
1066 pushop.repo, pushop.outgoing, version, b'push' 1066 pushop.repo, pushop.outgoing, version, b'push'
1067 ) 1067 )
1068 cgpart = bundler.newpart(b'changegroup', data=cgstream) 1068 cgpart = bundler.newpart(b'changegroup', data=cgstream)
1069 if cgversions: 1069 if cgversions:
1070 cgpart.addparam(b'version', version) 1070 cgpart.addparam(b'version', version)
1071 if requirements.TREEMANIFEST_REQUIREMENT in pushop.repo.requirements: 1071 if scmutil.istreemanifest(pushop.repo):
1072 cgpart.addparam(b'treemanifest', b'1') 1072 cgpart.addparam(b'treemanifest', b'1')
1073 if b'exp-sidedata-flag' in pushop.repo.requirements: 1073 if b'exp-sidedata-flag' in pushop.repo.requirements:
1074 cgpart.addparam(b'exp-sidedata', b'1') 1074 cgpart.addparam(b'exp-sidedata', b'1')
1075 1075
1076 def handlereply(op): 1076 def handlereply(op):
2555 if cgversions: 2555 if cgversions:
2556 part.addparam(b'version', version) 2556 part.addparam(b'version', version)
2557 2557
2558 part.addparam(b'nbchanges', b'%d' % len(outgoing.missing), mandatory=False) 2558 part.addparam(b'nbchanges', b'%d' % len(outgoing.missing), mandatory=False)
2559 2559
2560 if requirements.TREEMANIFEST_REQUIREMENT in repo.requirements: 2560 if scmutil.istreemanifest(repo):
2561 part.addparam(b'treemanifest', b'1') 2561 part.addparam(b'treemanifest', b'1')
2562 2562
2563 if b'exp-sidedata-flag' in repo.requirements: 2563 if b'exp-sidedata-flag' in repo.requirements:
2564 part.addparam(b'exp-sidedata', b'1') 2564 part.addparam(b'exp-sidedata', b'1')
2565 2565