mercurial/dirstate.py
branchstable
changeset 16201 fb7c4c14223f
parent 16200 9d4a2942a732
child 16202 53e2cd303ecf
--- a/mercurial/dirstate.py	Thu Mar 01 17:39:58 2012 +0200
+++ b/mercurial/dirstate.py	Thu Mar 01 17:42:49 2012 +0200
@@ -14,6 +14,12 @@
 
 _format = ">cllll"
 propertycache = util.propertycache
+filecache = scmutil.filecache
+
+class repocache(filecache):
+    """filecache for files in .hg/"""
+    def join(self, obj, fname):
+        return obj._opener.join(fname)
 
 def _finddirs(path):
     pos = path.rfind('/')
@@ -78,7 +84,7 @@
         f['.'] = '.' # prevents useless util.fspath() invocation
         return f
 
-    @propertycache
+    @repocache('branch')
     def _branch(self):
         try:
             return self._opener.read("branch").strip() or "default"