Patchwork [2,of,2] repoview: make explicite conversion from node to rev while computing hidden

login
register
mail settings
Submitter Pierre-Yves David
Date April 13, 2014, 8:45 p.m.
Message ID <c31b86d1e35cd920a12f.1397421945@marginatus.alto.octopoid.net>
Download mbox | patch
Permalink /patch/4337/
State Accepted
Headers show

Comments

Pierre-Yves David - April 13, 2014, 8:45 p.m.
# HG changeset patch
# User Pierre-Yves David <pierre-yves.david@fb.com>
# Date 1397421411 14400
#      Sun Apr 13 16:36:51 2014 -0400
# Node ID c31b86d1e35cd920a12ff456abed296e4ea0802d
# Parent  9be440eaf7acf9c3b3dfc9f551537c32b5fe107c
repoview: make explicite conversion from node to rev while computing hidden

You cannot use `repo[...]` lookup there. 1. It is slow 2. it is very likely to
stringer an hidden computation itself, entering an infinite loop.
Pierre-Yves David - April 16, 2014, 9:47 p.m.
On 04/13/2014 04:45 PM, pierre-yves.david@ens-lyon.org wrote:
> # HG changeset patch
> # User Pierre-Yves David <pierre-yves.david@fb.com>
> # Date 1397421411 14400
> #      Sun Apr 13 16:36:51 2014 -0400
> # Node ID c31b86d1e35cd920a12ff456abed296e4ea0802d
> # Parent  9be440eaf7acf9c3b3dfc9f551537c32b5fe107c
> repoview: make explicite conversion from node to rev while computing hidden
>
> You cannot use `repo[...]` lookup there. 1. It is slow 2. it is very likely to
> stringer an hidden computation itself, entering an infinite loop.

I've queued those in the clown copter after IRL review from Matt

Patch

diff --git a/mercurial/repoview.py b/mercurial/repoview.py
--- a/mercurial/repoview.py
+++ b/mercurial/repoview.py
@@ -34,15 +34,15 @@  def _gethiddenblockers(repo):
             '(%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():
-            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):
     """compute the set of hidden revision to filter