comparison mercurial/localrepo.py @ 3450:27ebe4efe98e

invalidate the branch cache when sanity check fails
author Benoit Boissinot <benoit.boissinot@ens-lyon.org>
date Wed, 18 Oct 2006 09:26:23 +0200
parents 6ca49c5fe268
children fcf14d87e0a4
comparison
equal deleted inserted replaced
3449:c8686e3f0291 3450:27ebe4efe98e
302 if (lrev < self.changelog.count() and 302 if (lrev < self.changelog.count() and
303 self.changelog.node(lrev) == last): # sanity check 303 self.changelog.node(lrev) == last): # sanity check
304 for l in f: 304 for l in f:
305 node, label = l.rstrip().split(" ", 1) 305 node, label = l.rstrip().split(" ", 1)
306 self.branchcache[label] = bin(node) 306 self.branchcache[label] = bin(node)
307 else: # invalidate the cache
308 last, lrev = nullid, -1
307 f.close() 309 f.close()
308 except IOError: 310 except IOError:
309 last, lrev = nullid, -1 311 last, lrev = nullid, -1
310 lrev = self.changelog.rev(last)
311 312
312 tip = self.changelog.count() - 1 313 tip = self.changelog.count() - 1
313 if lrev != tip: 314 if lrev != tip:
314 for r in xrange(lrev + 1, tip + 1): 315 for r in xrange(lrev + 1, tip + 1):
315 c = self.changectx(r) 316 c = self.changectx(r)