##// END OF EJS Templates
branchmap: prevent reading the file twice through different iterators...
Pulkit Goyal -
r41974:8ad46ac6 default
parent child Browse files
Show More
@@ -179,7 +179,7 b' class branchcache(dict):'
179 if not bcache.validfor(repo):
179 if not bcache.validfor(repo):
180 # invalidate the cache
180 # invalidate the cache
181 raise ValueError(r'tip differs')
181 raise ValueError(r'tip differs')
182 bcache.load(repo, f)
182 bcache.load(repo, lineiter)
183 except (IOError, OSError):
183 except (IOError, OSError):
184 return None
184 return None
185
185
@@ -198,10 +198,10 b' class branchcache(dict):'
198
198
199 return bcache
199 return bcache
200
200
201 def load(self, repo, f):
201 def load(self, repo, lineiter):
202 """ fully loads the branchcache by reading from the file f """
202 """ fully loads the branchcache by reading from the file using the line
203 iterator passed"""
203 cl = repo.changelog
204 cl = repo.changelog
204 lineiter = iter(f)
205 for line in lineiter:
205 for line in lineiter:
206 line = line.rstrip('\n')
206 line = line.rstrip('\n')
207 if not line:
207 if not line:
General Comments 0
You need to be logged in to leave comments. Login now