repoview: make the conversion from node to rev explicit while computing hidden
authorPierre-Yves David <pierre-yves.david@fb.com>
Sun, 13 Apr 2014 16:36:51 -0400
changeset 21059 d7e233df48e6
parent 21058 5152afc145e5
child 21060 0bea9db7543b
repoview: make the conversion from node to rev explicit while computing hidden You cannot use `repo[...]` lookup here. 1. It is slow 2. It is very likely to trigger a hidden computation itself, entering an infinite loop.
mercurial/repoview.py
--- a/mercurial/repoview.py	Sun Apr 13 16:39:31 2014 -0400
+++ b/mercurial/repoview.py	Sun Apr 13 16:36:51 2014 -0400
@@ -27,6 +27,7 @@
     hideable = hideablerevs(repo)
     blockers = []
     if hideable:
+        # We use cl to avoid recursive lookup from repo[xxx]
         cl = repo.changelog
         firsthideable = min(hideable)
         revs = cl.revs(start=firsthideable)
@@ -36,11 +37,11 @@
         for par in repo[None].parents():
             blockers.append(par.rev())
         for bm in repo._bookmarks.values():
-            blockers.append(repo[bm].rev())
+            blockers.append(cl.rev(bm))
         tags = {}
         tagsmod.readlocaltags(repo.ui, repo, tags, {})
         if tags:
-            blockers.extend(repo[t[0]].rev() for t in tags.values())
+            blockers.extend(cl.rev(t[0]) for t in tags.values())
     return blockers
 
 def computehidden(repo):