Patchwork D7099: widening: pass in matchers instead of patterns

login
register
mail settings
Submitter phabricator
Date Oct. 16, 2019, 2:23 p.m.
Message ID <da71e9a7e30262bb8054f8c8c23c887b@localhost.localdomain>
Download mbox | patch
Permalink /patch/42400/
State Not Applicable
Headers show

Comments

phabricator - Oct. 16, 2019, 2:23 p.m.
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




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

Patch

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"