Mercurial > hg
comparison mercurial/localrepo.py @ 3443:e6045fc3cd50
Improve branch cache sanity check for mq
author | Matt Mackall <mpm@selenic.com> |
---|---|
date | Wed, 18 Oct 2006 02:08:33 -0500 |
parents | 0f1fd9854cdc |
children | 6ca49c5fe268 |
comparison
equal
deleted
inserted
replaced
3442:798bcde0c9c2 | 3443:e6045fc3cd50 |
---|---|
297 | 297 |
298 try: | 298 try: |
299 f = self.opener("branches.cache") | 299 f = self.opener("branches.cache") |
300 last, lrev = f.readline().rstrip().split(" ", 1) | 300 last, lrev = f.readline().rstrip().split(" ", 1) |
301 last, lrev = bin(last), int(lrev) | 301 last, lrev = bin(last), int(lrev) |
302 if self.changelog.node(lrev) == last: # sanity check | 302 if (lrev < self.changelog.count() and |
303 self.changelog.node(lrev) == last): # sanity check | |
303 for l in f: | 304 for l in f: |
304 node, label = l.rstrip().split(" ", 1) | 305 node, label = l.rstrip().split(" ", 1) |
305 self.branchcache[label] = bin(node) | 306 self.branchcache[label] = bin(node) |
306 f.close() | 307 f.close() |
307 except IOError: | 308 except IOError: |