Patchwork [08,of,10,V2] branchmap: use a different file name for filtered view of repo

login
register
mail settings
Submitter Pierre-Yves David
Date Dec. 28, 2012, 12:56 a.m.
Message ID <427da70a9d079c6ef914.1356656183@yamac.lan>
Download mbox | patch
Permalink /patch/313/
State Superseded, archived
Commit 4df8716d32f188caae4da08790afaedb2b383dfc
Headers show

Comments

Pierre-Yves David - Dec. 28, 2012, 12:56 a.m.
# HG changeset patch
# User Pierre-Yves David <pierre-yves.david at ens-lyon.org>
# Date 1356314763 -3600
# Node ID 427da70a9d079c6ef91408bad67070fc4c1441ff
# Parent  abf14e45d19b7f1e439251999ea5fb25d184b326
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')