Patchwork [4,of,5,py3,progress] match: use ctx.getfileset() instead of fileset.getfileset()

login
register
mail settings
Submitter Augie Fackler
Date Feb. 4, 2014, 8:50 p.m.
Message ID <5100071fb8beed4a73cb.1391547018@augie-macbookair>
Download mbox | patch
Permalink /patch/3468/
State Superseded
Commit 906358d0350e51f346ad5228d64ddfd5e3e16a7b
Headers show

Comments

Augie Fackler - Feb. 4, 2014, 8:50 p.m.
# HG changeset patch
# User Augie Fackler <raf@durin42.com>
# Date 1391543682 18000
#      Tue Feb 04 14:54:42 2014 -0500
# Node ID 5100071fb8beed4a73cb626778bda483e641ef12
# Parent  d8f4c1f1953e7eaaf0d03a951be9bb8ca7f34122
match: use ctx.getfileset() instead of fileset.getfileset()

Resolves an import cycle involving match and merge.

Patch

diff --git a/mercurial/match.py b/mercurial/match.py
--- a/mercurial/match.py
+++ b/mercurial/match.py
@@ -6,7 +6,7 @@ 
 # GNU General Public License version 2 or any later version.
 
 import re
-import util, fileset, pathutil
+import util, pathutil
 from i18n import _
 
 def _rematcher(pat):
@@ -26,7 +26,7 @@ 
         if kind == 'set':
             if not ctx:
                 raise util.Abort("fileset expression with no context")
-            s = fileset.getfileset(ctx, expr)
+            s = ctx.getfileset(expr)
             fset.update(s)
             continue
         other.append((kind, expr))
diff --git a/tests/test-module-imports.t b/tests/test-module-imports.t
--- a/tests/test-module-imports.t
+++ b/tests/test-module-imports.t
@@ -34,6 +34,3 @@ 
   mercurial/ui.py mixed stdlib and relative imports:
      config, error, formatter, scmutil, util
   Import cycle: mercurial.repoview -> mercurial.revset -> mercurial.repoview
-  Import cycle: mercurial.fileset -> mercurial.merge -> mercurial.subrepo -> mercurial.match -> mercurial.fileset
-  Import cycle: mercurial.filemerge -> mercurial.match -> mercurial.fileset -> mercurial.merge -> mercurial.filemerge
-  Import cycle: mercurial.cmdutil -> mercurial.match -> mercurial.fileset -> mercurial.merge -> mercurial.subrepo -> mercurial.cmdutil -> mercurial.cmdutil