Mercurial > hg
comparison mercurial/exchange.py @ 45372:77b8588dd84e
requirements: introduce new requirements related module
It was not clear where all requirements should and related APIs should be, this
patch introduces a requirements module which will have all exitsing requirements
and related APIs.
Differential Revision: https://phab.mercurial-scm.org/D8917
author | Pulkit Goyal <7895pulkit@gmail.com> |
---|---|
date | Sat, 08 Aug 2020 16:24:12 +0530 |
parents | e58e234096de |
children | 10284ce3d5ed |
comparison
equal
deleted
inserted
replaced
45371:e58e234096de | 45372:77b8588dd84e |
---|---|
30 obsolete, | 30 obsolete, |
31 obsutil, | 31 obsutil, |
32 phases, | 32 phases, |
33 pushkey, | 33 pushkey, |
34 pycompat, | 34 pycompat, |
35 requirements, | |
35 scmutil, | 36 scmutil, |
36 sslutil, | 37 sslutil, |
37 streamclone, | 38 streamclone, |
38 url as urlmod, | 39 url as urlmod, |
39 util, | 40 util, |
40 wireprototypes, | 41 wireprototypes, |
41 ) | 42 ) |
42 from .interfaces import repository | |
43 from .utils import ( | 43 from .utils import ( |
44 hashutil, | 44 hashutil, |
45 stringutil, | 45 stringutil, |
46 ) | 46 ) |
47 | 47 |
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 repository.TREEMANIFEST_REQUIREMENT in pushop.repo.requirements: | 1071 if requirements.TREEMANIFEST_REQUIREMENT in pushop.repo.requirements: |
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): |
1689 | 1689 |
1690 while True: | 1690 while True: |
1691 old_heads = unficl.heads() | 1691 old_heads = unficl.heads() |
1692 clstart = len(unficl) | 1692 clstart = len(unficl) |
1693 _pullbundle2(pullop) | 1693 _pullbundle2(pullop) |
1694 if repository.NARROW_REQUIREMENT in repo.requirements: | 1694 if requirements.NARROW_REQUIREMENT in repo.requirements: |
1695 # XXX narrow clones filter the heads on the server side during | 1695 # XXX narrow clones filter the heads on the server side during |
1696 # XXX getbundle and result in partial replies as well. | 1696 # XXX getbundle and result in partial replies as well. |
1697 # XXX Disable pull bundles in this case as band aid to avoid | 1697 # XXX Disable pull bundles in this case as band aid to avoid |
1698 # XXX extra round trips. | 1698 # XXX extra round trips. |
1699 break | 1699 break |
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 repository.TREEMANIFEST_REQUIREMENT in repo.requirements: | 2560 if requirements.TREEMANIFEST_REQUIREMENT in repo.requirements: |
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 |