repoview: use repo.revs() instead of a private revset method
authorAugie Fackler <raf@durin42.com>
Tue, 04 Feb 2014 17:13:45 -0500
changeset 20405 cb63aa14aaf7
parent 20404 466707047c8d
child 20406 9e331f1f0573
repoview: use repo.revs() instead of a private revset method Breaks an import cycle.
mercurial/repoview.py
tests/test-module-imports.t
--- a/mercurial/repoview.py	Tue Feb 04 14:55:04 2014 -0500
+++ b/mercurial/repoview.py	Tue Feb 04 17:13:45 2014 -0500
@@ -9,7 +9,7 @@
 import copy
 import phases
 import util
-import obsolete, revset
+import obsolete
 
 
 def hideablerevs(repo):
@@ -28,8 +28,9 @@
         cl = repo.changelog
         firsthideable = min(hideable)
         revs = cl.revs(start=firsthideable)
-        blockers = [r for r in revset._children(repo, revs, hideable)
-                      if r not in hideable]
+        tofilter = repo.revs(
+            '(%ld) and children(%ld)', list(revs), list(hideable))
+        blockers = [r for r in tofilter if r not in hideable]
         for par in repo[None].parents():
             blockers.append(par.rev())
         for bm in repo._bookmarks.values():
--- a/tests/test-module-imports.t	Tue Feb 04 14:55:04 2014 -0500
+++ b/tests/test-module-imports.t	Tue Feb 04 17:13:45 2014 -0500
@@ -38,5 +38,4 @@
   mercurial/ui.py mixed imports
      stdlib:    formatter
      relative:  config, error, scmutil, util
-  Import cycle: mercurial.repoview -> mercurial.revset -> mercurial.repoview
   Import cycle: mercurial.cmdutil -> mercurial.context -> mercurial.subrepo -> mercurial.cmdutil -> mercurial.cmdutil