D7099: widening: pass in matchers instead of patterns

martinvonz (Martin von Zweigbergk) phabricator at mercurial-scm.org
Wed Oct 16 10:23:12 EDT 2019


Closed by commit rHGc62229c8ddf6: widening: pass in matchers instead of patterns (authored by martinvonz).
This revision was automatically updated to reflect the committed changes.

REPOSITORY
  rHG Mercurial

CHANGES SINCE LAST UPDATE
  https://phab.mercurial-scm.org/D7099?vs=17153&id=17218

CHANGES SINCE LAST ACTION
  https://phab.mercurial-scm.org/D7099/new/

REVISION DETAIL
  https://phab.mercurial-scm.org/D7099

AFFECTED FILES
  hgext/narrow/narrowbundle2.py
  hgext/narrow/narrowwirepeer.py

CHANGE DETAILS

diff --git a/hgext/narrow/narrowwirepeer.py b/hgext/narrow/narrowwirepeer.py
--- a/hgext/narrow/narrowwirepeer.py
+++ b/hgext/narrow/narrowwirepeer.py
@@ -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)
diff --git a/hgext/narrow/narrowbundle2.py b/hgext/narrow/narrowbundle2.py
--- a/hgext/narrow/narrowbundle2.py
+++ b/hgext/narrow/narrowbundle2.py
@@ -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"



To: martinvonz, durin42, #hg-reviewers, pulkit
Cc: pulkit, mercurial-devel


More information about the Mercurial-devel mailing list