changeset 43249:63d440bef72a

widening: pass in matchers instead of patterns This matches how it's done for the non-ellipsis case. The oldmatch is not used yet, but it should be used eventually when widening no longer resends manifests and files the client already has. Differential Revision: https://phab.mercurial-scm.org/D7099
author Martin von Zweigbergk <martinvonz@google.com>
date Fri, 11 Oct 2019 00:18:34 -0700
parents 2673f9a74968
children 98d996a138de
files hgext/narrow/narrowbundle2.py hgext/narrow/narrowwirepeer.py
diffstat 2 files changed, 8 insertions(+), 28 deletions(-) [+]
line wrap: on
line diff
--- a/hgext/narrow/narrowbundle2.py	Thu Oct 10 22:41:50 2019 -0700
+++ b/hgext/narrow/narrowbundle2.py	Fri Oct 11 00:18:34 2019 -0700
@@ -112,20 +112,8 @@
 
 
 def generate_ellipses_bundle2_for_widening(
-    bundler,
-    repo,
-    oldinclude,
-    oldexclude,
-    newinclude,
-    newexclude,
-    version,
-    common,
-    known,
+    bundler, repo, oldmatch, newmatch, version, common, known,
 ):
-    newmatch = narrowspec.match(
-        repo.root, include=newinclude, exclude=newexclude
-    )
-
     common = set(common or [nullid])
     # Steps:
     # 1. Send kill for "$known & ::common"
--- a/hgext/narrow/narrowwirepeer.py	Thu Oct 10 22:41:50 2019 -0700
+++ b/hgext/narrow/narrowwirepeer.py	Fri Oct 11 00:18:34 2019 -0700
@@ -102,13 +102,13 @@
         cgversion = cgversion
 
         bundler = bundle2.bundle20(repo.ui)
+        newmatch = narrowspec.match(
+            repo.root, include=newincludes, exclude=newexcludes
+        )
+        oldmatch = narrowspec.match(
+            repo.root, include=oldincludes, exclude=oldexcludes
+        )
         if not ellipses:
-            newmatch = narrowspec.match(
-                repo.root, include=newincludes, exclude=newexcludes
-            )
-            oldmatch = narrowspec.match(
-                repo.root, include=oldincludes, exclude=oldexcludes
-            )
             bundle2.widen_bundle(
                 bundler,
                 repo,
@@ -121,15 +121,7 @@
             )
         else:
             narrowbundle2.generate_ellipses_bundle2_for_widening(
-                bundler,
-                repo,
-                oldincludes,
-                oldexcludes,
-                newincludes,
-                newexcludes,
-                cgversion,
-                common,
-                known,
+                bundler, repo, oldmatch, newmatch, cgversion, common, known,
             )
     except error.Abort as exc:
         bundler = bundle2.bundle20(repo.ui)