[PATCH 6 of 6 py3 progress v2] repoview: use repo.revs() instead of a private revset method

Augie Fackler raf at durin42.com
Tue Feb 4 16:24:40 CST 2014


# HG changeset patch
# User Augie Fackler <raf at durin42.com>
# Date 1391552025 18000
#      Tue Feb 04 17:13:45 2014 -0500
# Node ID ef92408103c0ce249f862e5d7a30a715e5e7b622
# Parent  f5feb6d0ebf4e9230b3f0de91c0ae76dbe1ba408
repoview: use repo.revs() instead of a private revset method

Breaks an import cycle.

diff --git a/mercurial/repoview.py b/mercurial/repoview.py
--- a/mercurial/repoview.py
+++ b/mercurial/repoview.py
@@ -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():
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
@@ -33,4 +33,3 @@
      config, error, parser, templatefilters, util
   mercurial/ui.py mixed stdlib and relative imports:
      config, error, formatter, scmutil, util
-  Import cycle: mercurial.repoview -> mercurial.revset -> mercurial.repoview


More information about the Mercurial-devel mailing list