D1976: narrow: drop legacy support for getsubsetraw

durin42 (Augie Fackler) phabricator at mercurial-scm.org
Mon Feb 12 18:17:40 EST 2018


This revision was automatically updated to reflect the committed changes.
Closed by commit rHG48c12b440b4a: narrow: drop legacy support for getsubsetraw (authored by durin42, committed by ).

REPOSITORY
  rHG Mercurial

CHANGES SINCE LAST UPDATE
  https://phab.mercurial-scm.org/D1976?vs=5097&id=5543

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, indygreg
Cc: mercurial-devel


More information about the Mercurial-devel mailing list