Commits

Pierre-Yves David  committed 493778b

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.

  • Participants
  • Parent commits 518c140

Comments (0)

Files changed (1)

File mercurial/branchmap.py

         lines = f.read().split('\n')
         f.close()
     except (IOError, OSError):
-        return branchcache()
+        return None
 
     try:
         cachekey = lines.pop(0).split(" ", 2)
                 msg += ' (%s)' % repo.filtername
             msg += ': %s\n'
             repo.ui.warn(msg % inst)
-        partial = branchcache()
+        partial = None
     return partial
 
 
 
     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