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

login
register
mail settings
Submitter Pierre-Yves David
Date Dec. 26, 2012, 8:33 p.m.
Message ID <4d19904ae62475625f18.1356553984@yamac.local>
Download mbox | patch
Permalink /patch/304/
State Superseded, archived
Commit 46ed5226503a3f53194773a57f2e46ba315d6518
Headers show

Comments

Pierre-Yves David - Dec. 26, 2012, 8:33 p.m.
# 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.

Patch

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