branchmap: move the cache file name into a dedicated function
Filtered view of the repo will want to write they file name in a different file.
--- a/mercurial/branchmap.py Tue Jan 01 18:19:24 2013 +0100
+++ b/mercurial/branchmap.py Mon Dec 24 03:04:12 2012 +0100
@@ -9,9 +9,13 @@
import encoding
import util
+def _filename(repo):
+ """name of a branchcache file for a given repo"""
+ return "cache/branchheads"
+
def read(repo):
try:
- f = repo.opener("cache/branchheads")
+ f = repo.opener(_filename(repo))
lines = f.read().split('\n')
f.close()
except (IOError, OSError):
@@ -117,7 +121,7 @@
def write(self, repo):
try:
- f = repo.opener("cache/branchheads", "w", atomictemp=True)
+ f = repo.opener(_filename(repo), "w", atomictemp=True)
cachekey = [hex(self.tipnode), str(self.tiprev)]
if self.filteredhash is not None:
cachekey.append(hex(self.filteredhash))