Details
Details
- Reviewers
indygreg - Group Reviewers
hg-reviewers - Commits
- rHG48c12b440b4a: narrow: drop legacy support for getsubsetraw
Diff Detail
Diff Detail
- Repository
- rHG Mercurial
- Lint
Lint Skipped - Unit
Unit Tests Skipped
( )
indygreg |
hg-reviewers |
Lint Skipped |
Unit Tests Skipped |
Path | Packages | |||
---|---|---|---|---|
M | hgext/narrow/narrowbundle2.py (21 lines) |
Status | Author | Revision | |
---|---|---|---|
Closed | durin42 | ||
Closed | durin42 | ||
Closed | durin42 | ||
Closed | durin42 | ||
Closed | durin42 | ||
Closed | durin42 | ||
Closed | durin42 | ||
Closed | durin42 | ||
Closed | durin42 | ||
Closed | durin42 | ||
Closed | durin42 | ||
Closed | durin42 | ||
Closed | durin42 | ||
Closed | durin42 | ||
Closed | durin42 | ||
Closed | durin42 | ||
Closed | durin42 | ||
Closed | durin42 | ||
Closed | durin42 | ||
Closed | durin42 | ||
Closed | durin42 | ||
Closed | durin42 | ||
Closed | durin42 | ||
Closed | durin42 | ||
Closed | durin42 | ||
Closed | durin42 |
include = sorted(filter(bool, kwargs.get('includepats', []))) | include = sorted(filter(bool, kwargs.get('includepats', []))) | ||||
exclude = sorted(filter(bool, kwargs.get('excludepats', []))) | exclude = sorted(filter(bool, kwargs.get('excludepats', []))) | ||||
newmatch = narrowspec.match(repo.root, include=include, exclude=exclude) | newmatch = narrowspec.match(repo.root, include=include, exclude=exclude) | ||||
if not repo.ui.configbool("experimental", "narrowservebrokenellipses"): | if not repo.ui.configbool("experimental", "narrowservebrokenellipses"): | ||||
outgoing = exchange._computeoutgoing(repo, heads, common) | outgoing = exchange._computeoutgoing(repo, heads, common) | ||||
if not outgoing.missing: | if not outgoing.missing: | ||||
return | return | ||||
if util.safehasattr(changegroup, 'getsubsetraw'): | |||||
# getsubsetraw was replaced with makestream in hg in 92f1e2be8ab6 | |||||
# (2017/09/10). | |||||
packer = changegroup.getbundler(version, repo) | |||||
packer._narrow_matcher = lambda : newmatch | |||||
cg = changegroup.getsubsetraw(repo, outgoing, packer, source) | |||||
else: | |||||
def wrappedgetbundler(orig, *args, **kwargs): | def wrappedgetbundler(orig, *args, **kwargs): | ||||
bundler = orig(*args, **kwargs) | bundler = orig(*args, **kwargs) | ||||
bundler._narrow_matcher = lambda : newmatch | bundler._narrow_matcher = lambda : newmatch | ||||
return bundler | return bundler | ||||
with extensions.wrappedfunction(changegroup, 'getbundler', | with extensions.wrappedfunction(changegroup, 'getbundler', | ||||
wrappedgetbundler): | wrappedgetbundler): | ||||
cg = changegroup.makestream(repo, outgoing, version, source) | cg = changegroup.makestream(repo, outgoing, version, source) | ||||
part = bundler.newpart('changegroup', data=cg) | part = bundler.newpart('changegroup', data=cg) | ||||
part.addparam('version', version) | part.addparam('version', version) | ||||
if 'treemanifest' in repo.requirements: | if 'treemanifest' in repo.requirements: | ||||
part.addparam('treemanifest', '1') | part.addparam('treemanifest', '1') | ||||
if include or exclude: | if include or exclude: | ||||
narrowspecpart = bundler.newpart(specpart) | narrowspecpart = bundler.newpart(specpart) | ||||
if include: | if include: |