Mercurial > hg
comparison hgext/narrow/narrowbundle2.py @ 45552: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 | 89a2afe31e82 |
comparison
equal
deleted
inserted
replaced
45551:4c8d9b53b1c7 | 45552:10284ce3d5ed |
---|---|
106 ) | 106 ) |
107 cgdata = packer.generate(common, visitnodes, False, b'narrow_widen') | 107 cgdata = packer.generate(common, visitnodes, False, b'narrow_widen') |
108 | 108 |
109 part = bundler.newpart(b'changegroup', data=cgdata) | 109 part = bundler.newpart(b'changegroup', data=cgdata) |
110 part.addparam(b'version', version) | 110 part.addparam(b'version', version) |
111 if requirements.TREEMANIFEST_REQUIREMENT in repo.requirements: | 111 if scmutil.istreemanifest(repo): |
112 part.addparam(b'treemanifest', b'1') | 112 part.addparam(b'treemanifest', b'1') |
113 | 113 |
114 | 114 |
115 def generate_ellipses_bundle2_for_widening( | 115 def generate_ellipses_bundle2_for_widening( |
116 bundler, repo, oldmatch, newmatch, version, common, known, | 116 bundler, repo, oldmatch, newmatch, version, common, known, |
161 ) | 161 ) |
162 cgdata = packer.generate(common, newvisit, False, b'narrow_widen') | 162 cgdata = packer.generate(common, newvisit, False, b'narrow_widen') |
163 | 163 |
164 part = bundler.newpart(b'changegroup', data=cgdata) | 164 part = bundler.newpart(b'changegroup', data=cgdata) |
165 part.addparam(b'version', version) | 165 part.addparam(b'version', version) |
166 if requirements.TREEMANIFEST_REQUIREMENT in repo.requirements: | 166 if scmutil.istreemanifest(repo): |
167 part.addparam(b'treemanifest', b'1') | 167 part.addparam(b'treemanifest', b'1') |
168 | 168 |
169 | 169 |
170 @bundle2.parthandler(_SPECPART, (_SPECPART_INCLUDE, _SPECPART_EXCLUDE)) | 170 @bundle2.parthandler(_SPECPART, (_SPECPART_INCLUDE, _SPECPART_EXCLUDE)) |
171 def _handlechangespec_2(op, inpart): | 171 def _handlechangespec_2(op, inpart): |