mercurial/tags.py
branchstable
changeset 11066 26abd91d9e84
parent 10263 25e572394f5c
child 11078 37d1b20168d1
--- a/mercurial/tags.py	Fri Apr 30 18:11:56 2010 +0200
+++ b/mercurial/tags.py	Mon Apr 26 20:13:14 2010 +0900
@@ -197,6 +197,8 @@
 
     try:
         cachefile = repo.opener('tags.cache', 'r')
+        # force reading the file for static-http
+        cachelines = iter(cachefile)
         _debug(ui, 'reading tag cache from %s\n' % cachefile.name)
     except IOError:
         cachefile = None
@@ -217,7 +219,7 @@
     cacheheads = []                     # list of headnode
     cachefnode = {}                     # map headnode to filenode
     if cachefile:
-        for line in cachefile:
+        for line in cachelines:
             if line == "\n":
                 break
             line = line.rstrip().split()
@@ -237,7 +239,7 @@
     # have been destroyed by strip or rollback.)
     if cacheheads and cacheheads[0] == tipnode and cacherevs[0] == tiprev:
         _debug(ui, "tag cache: tip unchanged\n")
-        tags = _readtags(ui, repo, cachefile, cachefile.name)
+        tags = _readtags(ui, repo, cachelines, cachefile.name)
         cachefile.close()
         return (None, None, tags, False)
     if cachefile: