mercurial/tags.py
changeset 11351 1cdc8b5e5729
parent 11078 37d1b20168d1
child 11352 b19067ee4507
--- a/mercurial/tags.py	Tue Jun 15 17:15:31 2010 +0200
+++ b/mercurial/tags.py	Tue Jun 15 15:02:54 2010 -0400
@@ -27,37 +27,12 @@
 _debug = _debugalways
 _debug = _debugnever
 
-def findglobaltags1(ui, repo, alltags, tagtypes):
+def findglobaltags(ui, repo, alltags, tagtypes):
     '''Find global tags in repo by reading .hgtags from every head that
-    has a distinct version of it.  Updates the dicts alltags, tagtypes
-    in place: alltags maps tag name to (node, hist) pair (see _readtags()
-    below), and tagtypes maps tag name to tag type ('global' in this
-    case).'''
-
-    seen = set()
-    fctx = None
-    ctxs = []                       # list of filectx
-    for node in repo.heads():
-        try:
-            fnode = repo[node].filenode('.hgtags')
-        except error.LookupError:
-            continue
-        if fnode not in seen:
-            seen.add(fnode)
-            if not fctx:
-                fctx = repo.filectx('.hgtags', fileid=fnode)
-            else:
-                fctx = fctx.filectx(fnode)
-            ctxs.append(fctx)
-
-    # read the tags file from each head, ending with the tip
-    for fctx in reversed(ctxs):
-        filetags = _readtags(
-            ui, repo, fctx.data().splitlines(), fctx)
-        _updatetags(filetags, "global", alltags, tagtypes)
-
-def findglobaltags2(ui, repo, alltags, tagtypes):
-    '''Same as findglobaltags1(), but with caching.'''
+    has a distinct version of it, using a cache to avoid excess work.
+    Updates the dicts alltags, tagtypes in place: alltags maps tag name
+    to (node, hist) pair (see _readtags() below), and tagtypes maps tag
+    name to tag type ("global" in this case).'''
     # This is so we can be lazy and assume alltags contains only global
     # tags when we pass it to _writetagcache().
     assert len(alltags) == len(tagtypes) == 0, \
@@ -95,9 +70,6 @@
     if shouldwrite:
         _writetagcache(ui, repo, heads, tagfnode, alltags)
 
-# Set this to findglobaltags1 to disable tag caching.
-findglobaltags = findglobaltags2
-
 def readlocaltags(ui, repo, alltags, tagtypes):
     '''Read local tags in repo.  Update alltags and tagtypes.'''
     try: