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

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

Comments

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

Patch

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')