Mercurial > hg
comparison hgext/narrow/narrowbundle2.py @ 36081:48c12b440b4a
narrow: drop legacy support for getsubsetraw
Differential Revision: https://phab.mercurial-scm.org/D1976
author | Augie Fackler <augie@google.com> |
---|---|
date | Mon, 29 Jan 2018 18:12:17 -0500 |
parents | a2a6e724d61a |
children | bc01f48c18cc |
comparison
equal
deleted
inserted
replaced
36080:9dc28d8ea61e | 36081:48c12b440b4a |
---|---|
235 newmatch = narrowspec.match(repo.root, include=include, exclude=exclude) | 235 newmatch = narrowspec.match(repo.root, include=include, exclude=exclude) |
236 if not repo.ui.configbool("experimental", "narrowservebrokenellipses"): | 236 if not repo.ui.configbool("experimental", "narrowservebrokenellipses"): |
237 outgoing = exchange._computeoutgoing(repo, heads, common) | 237 outgoing = exchange._computeoutgoing(repo, heads, common) |
238 if not outgoing.missing: | 238 if not outgoing.missing: |
239 return | 239 return |
240 if util.safehasattr(changegroup, 'getsubsetraw'): | 240 def wrappedgetbundler(orig, *args, **kwargs): |
241 # getsubsetraw was replaced with makestream in hg in 92f1e2be8ab6 | 241 bundler = orig(*args, **kwargs) |
242 # (2017/09/10). | 242 bundler._narrow_matcher = lambda : newmatch |
243 packer = changegroup.getbundler(version, repo) | 243 return bundler |
244 packer._narrow_matcher = lambda : newmatch | 244 with extensions.wrappedfunction(changegroup, 'getbundler', |
245 cg = changegroup.getsubsetraw(repo, outgoing, packer, source) | 245 wrappedgetbundler): |
246 else: | 246 cg = changegroup.makestream(repo, outgoing, version, source) |
247 def wrappedgetbundler(orig, *args, **kwargs): | |
248 bundler = orig(*args, **kwargs) | |
249 bundler._narrow_matcher = lambda : newmatch | |
250 return bundler | |
251 with extensions.wrappedfunction(changegroup, 'getbundler', | |
252 wrappedgetbundler): | |
253 cg = changegroup.makestream(repo, outgoing, version, source) | |
254 part = bundler.newpart('changegroup', data=cg) | 247 part = bundler.newpart('changegroup', data=cg) |
255 part.addparam('version', version) | 248 part.addparam('version', version) |
256 if 'treemanifest' in repo.requirements: | 249 if 'treemanifest' in repo.requirements: |
257 part.addparam('treemanifest', '1') | 250 part.addparam('treemanifest', '1') |
258 | 251 |