Patchwork [4,of,4] repoview: improve performance for computehidden

mail settings
Submitter Sean Farley
Date March 28, 2014, 1:15 a.m.
Message ID <176080ac5588dc1ba588.1395969339@laptop.local>
Download mbox | patch
Permalink /patch/4093/
State Superseded
Headers show


Sean Farley - March 28, 2014, 1:15 a.m.
# HG changeset patch
# User Sean Farley <>
# Date 1395969295 18000
#      Thu Mar 27 20:14:55 2014 -0500
# Node ID 176080ac5588dc1ba588e80d9cc2e9f36bf2ec46
# Parent  28d2fa6ccef8f6f50b93a810e0fe811d6639d930
repoview: improve performance for computehidden

For repos with a large number of heads (including hidden heads), a stale tag
cache would cause computehidden to be drastically slower because of a the call
to repo.tags() (which would build the tag cache).

We actually don't need the tag cache for computehidden because we filter out
global tags. This patch replaces the call to repo.tags with repo.localtags so
as to avoid the tag cache.


diff --git a/mercurial/ b/mercurial/
--- a/mercurial/
+++ b/mercurial/
@@ -33,12 +33,11 @@  def computehidden(repo):
         blockers = [r for r in tofilter if r not in hideable]
         for par in repo[None].parents():
         for bm in repo._bookmarks.values():
-        tags = [n for t, n in repo.tags().iteritems()
-                if (repo.tagtype(t) and repo.tagtype(t) != 'global')]
+        tags = [n for t, n in repo.localtags().iteritems()]
         blockers.extend(repo[t].rev() for t in tags)
         blocked = cl.ancestors(blockers, inclusive=True)
         return frozenset(r for r in hideable if r not in blocked)
     return frozenset()