tags: visit new heads in forward order when rebuilding cache
This improves performance of building the tag cache by 4x on a repo
with ~2800 heads.
--- a/mercurial/tags.py Fri Jul 27 13:56:19 2012 +0200
+++ b/mercurial/tags.py Thu Jul 26 17:04:01 2012 -0500
@@ -241,7 +241,7 @@
# This is the most expensive part of finding tags, so performance
# depends primarily on the size of newheads. Worst case: no cache
# file, so newheads == repoheads.
- for head in newheads:
+ for head in reversed(newheads):
cctx = repo[head]
try:
fnode = cctx.filenode('.hgtags')