Patchwork [5,of,6,V3] branchmap: report filtername when read fails

login
register
mail settings
Submitter Pierre-Yves David
Date Jan. 1, 2013, 10:14 p.m.
Message ID <33ed55831aff4188e69c.1357078483@yamac.lan>
Download mbox | patch
Permalink /patch/344/
State Accepted
Commit 46ed5226503a3f53194773a57f2e46ba315d6518
Headers show

Comments

Pierre-Yves David - Jan. 1, 2013, 10:14 p.m.
# HG changeset patch
# User Pierre-Yves David <pierre-yves.david at logilab.fr>
# Date 1357072033 -3600
# Node ID 33ed55831aff4188e69c735592a154aabbc58394
# Parent  1b0ecc6b8996f47b1d2a7072d03ecc1f4ec891c5
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.

Patch

diff --git a/mercurial/branchmap.py b/mercurial/branchmap.py
--- a/mercurial/branchmap.py
+++ b/mercurial/branchmap.py
@@ -46,11 +46,15 @@  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'
+            if repo.filtername is not None:
+                msg += ' (%s)' % repo.filtername
+            msg += ': %s\n'
+            repo.ui.warn(msg % inst)
         partial = branchcache()
     return partial