[PATCH 7 of 9] branchmap: use a different file name for filtered view of repo

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


# HG changeset patch
# User Pierre-Yves David <pierre-yves.david at ens-lyon.org>
# Date 1356314763 -3600
# Node ID 979ca793032136bb50f4a96ab7452084738fb27f
# Parent  529cac3f16ce8da6e09f672090f1242aa2748e3d
branchmap: use a different file name for filtered view of repo

diff --git a/mercurial/branchmap.py b/mercurial/branchmap.py
--- a/mercurial/branchmap.py
+++ b/mercurial/branchmap.py
@@ -8,12 +8,15 @@
 from node import bin, hex, nullid, nullrev
 import encoding
 import util
 
 def _filename(repo):
-    """name of a branchcache file for a given repo"""
-    return "cache/branchheads"
+    """name of a branchcache file for a given repo or repoview"""
+    filename = "cache/branchheads"
+    if repo.filtername:
+        filename = '%s-%s' % (filename, repo.filtername)
+    return filename
 
 def read(repo):
     try:
         f = repo.opener(_filename(repo))
         lines = f.read().split('\n')


More information about the Mercurial-devel mailing list