##// END OF EJS Templates
don't use readline() to read branches.cache...
Alexis S. L. Carvalho -
r3668:6f669696 default
parent child Browse files
Show More
@@ -324,16 +324,18 b' class localrepository(repo.repository):'
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
General Comments 0
You need to be logged in to leave comments. Login now