mercurial/tags.py
changeset 21030 9ea132aee96c
parent 19646 335a558f81dc
child 21814 5125856a28cf
child 21823 925d1bb9a971
--- a/mercurial/tags.py	Mon Apr 14 15:14:02 2014 -0400
+++ b/mercurial/tags.py	Mon Apr 14 11:50:05 2014 -0700
@@ -15,6 +15,7 @@
 import encoding
 import error
 import errno
+import time
 
 def findglobaltags(ui, repo, alltags, tagtypes):
     '''Find global tags in repo by reading .hgtags from every head that
@@ -234,6 +235,8 @@
         # potentially expensive search.
         return (repoheads, cachefnode, None, True)
 
+    starttime = time.time()
+
     newheads = [head
                 for head in repoheads
                 if head not in set(cacheheads)]
@@ -251,6 +254,12 @@
             # no .hgtags file on this head
             pass
 
+    duration = time.time() - starttime
+    ui.log('tagscache',
+           'resolved %d tags cache entries from %d manifests in %0.4f '
+           'seconds\n',
+           len(cachefnode), len(newheads), duration)
+
     # Caller has to iterate over all heads, but can use the filenodes in
     # cachefnode to get to each .hgtags revision quickly.
     return (repoheads, cachefnode, None, True)
@@ -262,6 +271,9 @@
     except (OSError, IOError):
         return
 
+    ui.log('tagscache', 'writing tags cache file with %d heads and %d tags\n',
+            len(heads), len(cachetags))
+
     realheads = repo.heads()            # for sanity checks below
     for head in heads:
         # temporary sanity checks; these can probably be removed