D1976: narrow: drop legacy support for getsubsetraw
durin42 (Augie Fackler)
phabricator at mercurial-scm.org
Thu Feb 1 23:00:32 UTC 2018
durin42 created this revision.
Herald added a subscriber: mercurial-devel.
Herald added a reviewer: hg-reviewers.
REPOSITORY
rHG Mercurial
REVISION DETAIL
https://phab.mercurial-scm.org/D1976
AFFECTED FILES
hgext/narrow/narrowbundle2.py
CHANGE DETAILS
diff --git a/hgext/narrow/narrowbundle2.py b/hgext/narrow/narrowbundle2.py
--- a/hgext/narrow/narrowbundle2.py
+++ b/hgext/narrow/narrowbundle2.py
@@ -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:
To: durin42, #hg-reviewers
Cc: mercurial-devel
More information about the Mercurial-devel
mailing list