changeset 36119: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 9dc28d8ea61e
children adc8e1fe2f46
files hgext/narrow/narrowbundle2.py
diffstat 1 files changed, 7 insertions(+), 14 deletions(-) [+]
line wrap: on
line diff
--- 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: