[PATCH 8 of 9] branchmap: report filtername when read fails

Pierre-Yves David pierre-yves.david at ens-lyon.org
Wed Dec 26 14:33:04 CST 2012


# HG changeset patch
# User Pierre-Yves David <pierre-yves.david at logilab.fr>
# Date 1356188217 -3600
# Node ID 4d19904ae62475625f181b4fcd2a1244f9d185f9
# Parent  979ca793032136bb50f4a96ab7452084738fb27f
branchmap: report filtername when read fails

Now that we can have multiple one, we need to know which filecache failed to be
read from disk.

diff --git a/mercurial/branchmap.py b/mercurial/branchmap.py
--- a/mercurial/branchmap.py
+++ b/mercurial/branchmap.py
@@ -45,11 +45,14 @@ def read(repo):
             partial.setdefault(label, []).append(bin(node))
     except KeyboardInterrupt:
         raise
     except Exception, inst:
         if repo.ui.debugflag:
-            repo.ui.warn(('invalid branchheads cache: %s\n') % inst)
+            msg = 'invalid branchheads cache: %s\n'
+            if repo.filtername is not None:
+                msg = 'invalid branchheads cache (%s): %%s\n' % repo.filtername
+            repo.ui.warn(msg % inst)
         partial = branchcache()
     return partial
 
 
 


More information about the Mercurial-devel mailing list