narrow: drop legacy support for getsubsetraw
authorAugie Fackler <augie@google.com>
Mon, 29 Jan 2018 18:12:17 -0500
changeset 36081 48c12b440b4a
parent 36080 9dc28d8ea61e
child 36082 adc8e1fe2f46
narrow: drop legacy support for getsubsetraw Differential Revision: https://phab.mercurial-scm.org/D1976
hgext/narrow/narrowbundle2.py
--- 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: