changeset 22148:43f300a198d4

repoview: use set for blockers Blockers should be unique but tags and bookmarks could point to the same rev, therefore use a set to ensure that we don't have duplicates.
author David Soria Parra <davidsp@fb.com>
date Tue, 12 Aug 2014 16:42:24 -0700
parents 44d6818b9cd9
children 16ef2c485f03
files mercurial/repoview.py
diffstat 1 files changed, 4 insertions(+), 4 deletions(-) [+]
line wrap: on
line diff
--- a/mercurial/repoview.py	Wed Aug 13 15:06:58 2014 -0500
+++ b/mercurial/repoview.py	Tue Aug 12 16:42:24 2014 -0700
@@ -33,16 +33,16 @@
         revs = cl.revs(start=firsthideable)
         tofilter = repo.revs(
             '(%ld) and children(%ld)', list(revs), list(hideable))
-        blockers = [r for r in tofilter if r not in hideable]
+        blockers = set([r for r in tofilter if r not in hideable])
         for par in repo[None].parents():
-            blockers.append(par.rev())
+            blockers.add(par.rev())
         for bm in repo._bookmarks.values():
-            blockers.append(cl.rev(bm))
+            blockers.add(cl.rev(bm))
         tags = {}
         tagsmod.readlocaltags(repo.ui, repo, tags, {})
         if tags:
             rev, nodemap = cl.rev, cl.nodemap
-            blockers.extend(rev(t[0]) for t in tags.values() if t[0] in nodemap)
+            blockers.update(rev(t[0]) for t in tags.values() if t[0] in nodemap)
     return blockers
 
 def computehidden(repo):