narrow: drop legacy support for getsubsetraw
Differential Revision: https://phab.mercurial-scm.org/D1976
--- a/hgext/narrow/narrowbundle2.py Mon Jan 29 18:08:56 2018 -0500
+++ b/hgext/narrow/narrowbundle2.py Mon Jan 29 18:12:17 2018 -0500
@@ -237,20 +237,13 @@
outgoing = exchange._computeoutgoing(repo, heads, common)
if not outgoing.missing:
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):
- bundler = orig(*args, **kwargs)
- bundler._narrow_matcher = lambda : newmatch
- return bundler
- with extensions.wrappedfunction(changegroup, 'getbundler',
- wrappedgetbundler):
- cg = changegroup.makestream(repo, outgoing, version, source)
+ def wrappedgetbundler(orig, *args, **kwargs):
+ bundler = orig(*args, **kwargs)
+ bundler._narrow_matcher = lambda : newmatch
+ return bundler
+ with extensions.wrappedfunction(changegroup, 'getbundler',
+ wrappedgetbundler):
+ cg = changegroup.makestream(repo, outgoing, version, source)
part = bundler.newpart('changegroup', data=cg)
part.addparam('version', version)
if 'treemanifest' in repo.requirements: