# HG changeset patch # User Pierre-Yves David # Date 1356201671 -3600 # Node ID 493778b5fe9f98088af708c948f5f5ee73d8fc61 # Parent 518c1403838f1d869fec357488d9221fea765177 branchmap: read return None in case of failure This makes a clear distinction between having read a valid cache on disk or not. This will help caches of various filtering level to collaborate. diff -r 518c1403838f -r 493778b5fe9f mercurial/branchmap.py --- a/mercurial/branchmap.py Sat Dec 29 00:40:18 2012 +0100 +++ b/mercurial/branchmap.py Sat Dec 22 19:41:11 2012 +0100 @@ -22,7 +22,7 @@ lines = f.read().split('\n') f.close() except (IOError, OSError): - return branchcache() + return None try: cachekey = lines.pop(0).split(" ", 2) @@ -53,7 +53,7 @@ msg += ' (%s)' % repo.filtername msg += ': %s\n' repo.ui.warn(msg % inst) - partial = branchcache() + partial = None return partial @@ -65,6 +65,8 @@ if partial is None or not partial.validfor(repo): partial = read(repo) + if partial is None: + partial = branchcache() catip = repo._cacheabletip() # if partial.tiprev == catip: cache is already up to date