Mercurial > hg > mercurial-crew-with-dirclash
comparison mercurial/localrepo.py @ 3650:6f6696962986
don't use readline() to read branches.cache
The posixfile_nt class used on windows doesn't have that method.
author | Alexis S. L. Carvalho <alexis@cecm.usp.br> |
---|---|
date | Wed, 15 Nov 2006 17:56:57 -0200 |
parents | cabe62800120 |
children | 6990e499d71a |
comparison
equal
deleted
inserted
replaced
3649:d5032b951c5c | 3650:6f6696962986 |
---|---|
322 | 322 |
323 def _readbranchcache(self): | 323 def _readbranchcache(self): |
324 partial = {} | 324 partial = {} |
325 try: | 325 try: |
326 f = self.opener("branches.cache") | 326 f = self.opener("branches.cache") |
327 last, lrev = f.readline().rstrip().split(" ", 1) | 327 lines = f.read().split('\n') |
328 f.close() | |
329 last, lrev = lines.pop(0).rstrip().split(" ", 1) | |
328 last, lrev = bin(last), int(lrev) | 330 last, lrev = bin(last), int(lrev) |
329 if (lrev < self.changelog.count() and | 331 if (lrev < self.changelog.count() and |
330 self.changelog.node(lrev) == last): # sanity check | 332 self.changelog.node(lrev) == last): # sanity check |
331 for l in f: | 333 for l in lines: |
334 if not l: continue | |
332 node, label = l.rstrip().split(" ", 1) | 335 node, label = l.rstrip().split(" ", 1) |
333 partial[label] = bin(node) | 336 partial[label] = bin(node) |
334 else: # invalidate the cache | 337 else: # invalidate the cache |
335 last, lrev = nullid, nullrev | 338 last, lrev = nullid, nullrev |
336 f.close() | |
337 except IOError: | 339 except IOError: |
338 last, lrev = nullid, nullrev | 340 last, lrev = nullid, nullrev |
339 return partial, last, lrev | 341 return partial, last, lrev |
340 | 342 |
341 def _writebranchcache(self, branches, tip, tiprev): | 343 def _writebranchcache(self, branches, tip, tiprev): |