invalidate the branch cache when sanity check fails
authorBenoit Boissinot <benoit.boissinot@ens-lyon.org>
Wed, 18 Oct 2006 09:26:23 +0200
changeset 3450 27ebe4efe98e
parent 3449 c8686e3f0291
child 3451 196baf20232b
invalidate the branch cache when sanity check fails
mercurial/localrepo.py
--- a/mercurial/localrepo.py	Wed Oct 18 02:14:26 2006 -0500
+++ b/mercurial/localrepo.py	Wed Oct 18 09:26:23 2006 +0200
@@ -304,10 +304,11 @@
                 for l in f:
                     node, label = l.rstrip().split(" ", 1)
                     self.branchcache[label] = bin(node)
+            else: # invalidate the cache
+                last, lrev = nullid, -1
             f.close()
         except IOError:
             last, lrev = nullid, -1
-            lrev = self.changelog.rev(last)
 
         tip = self.changelog.count() - 1
         if lrev != tip: