Patchwork [4,of,6,V3] branchmap: use a different file name for filtered view of repo

login
register
mail settings
Submitter Pierre-Yves David
Date Jan. 1, 2013, 10:14 p.m.
Message ID <1b0ecc6b8996f47b1d2a.1357078482@yamac.lan>
Download mbox | patch
Permalink /patch/343/
State Accepted
Commit 4df8716d32f188caae4da08790afaedb2b383dfc
Headers show

Comments

Pierre-Yves David - Jan. 1, 2013, 10:14 p.m.
# HG changeset patch
# User Pierre-Yves David <pierre-yves.david at ens-lyon.org>
# Date 1356314763 -3600
# Node ID 1b0ecc6b8996f47b1d2a7072d03ecc1f4ec891c5
# Parent  c568793f897554b8f8b0a05cf6cfc94c58d2c6e3
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')