diff -r 941685500125 -r 8ad46ac6728e mercurial/branchmap.py --- a/mercurial/branchmap.py Mon Feb 25 12:42:48 2019 -0800 +++ b/mercurial/branchmap.py Tue Feb 26 17:26:33 2019 +0300 @@ -179,7 +179,7 @@ if not bcache.validfor(repo): # invalidate the cache raise ValueError(r'tip differs') - bcache.load(repo, f) + bcache.load(repo, lineiter) except (IOError, OSError): return None @@ -198,10 +198,10 @@ return bcache - def load(self, repo, f): - """ fully loads the branchcache by reading from the file f """ + def load(self, repo, lineiter): + """ fully loads the branchcache by reading from the file using the line + iterator passed""" cl = repo.changelog - lineiter = iter(f) for line in lineiter: line = line.rstrip('\n') if not line: