don't use readline() to read branches.cache
The posixfile_nt class used on windows doesn't have that method.
--- a/mercurial/localrepo.py Mon Nov 13 21:50:09 2006 +0100
+++ b/mercurial/localrepo.py Wed Nov 15 17:56:57 2006 -0200
@@ -324,16 +324,18 @@
partial = {}
try:
f = self.opener("branches.cache")
- last, lrev = f.readline().rstrip().split(" ", 1)
+ lines = f.read().split('\n')
+ f.close()
+ last, lrev = lines.pop(0).rstrip().split(" ", 1)
last, lrev = bin(last), int(lrev)
if (lrev < self.changelog.count() and
self.changelog.node(lrev) == last): # sanity check
- for l in f:
+ for l in lines:
+ if not l: continue
node, label = l.rstrip().split(" ", 1)
partial[label] = bin(node)
else: # invalidate the cache
last, lrev = nullid, nullrev
- f.close()
except IOError:
last, lrev = nullid, nullrev
return partial, last, lrev