# HG changeset patch # User FUJIWARA Katsunori # Date 1498754869 -32400 # Node ID edb7f628ef8bb834ba3772df62a887eba5a931db # Parent 3b85c474cbcf9ea167fa55d5e4668b58eae26aa1 localrepo: factor out base of filecache annotation class It isn't needed that storecache is derived from repofilecache. Changes in this patch allow repofilecache and storecache to do in own __init__() differently from each other. diff -r 3b85c474cbcf -r edb7f628ef8b mercurial/localrepo.py --- a/mercurial/localrepo.py Fri Jun 30 01:47:48 2017 +0900 +++ b/mercurial/localrepo.py Fri Jun 30 01:47:49 2017 +0900 @@ -66,22 +66,24 @@ urlerr = util.urlerr urlreq = util.urlreq -class repofilecache(scmutil.filecache): +class _basefilecache(scmutil.filecache): """All filecache usage on repo are done for logic that should be unfiltered """ - - def join(self, obj, fname): - return obj.vfs.join(fname) def __get__(self, repo, type=None): if repo is None: return self - return super(repofilecache, self).__get__(repo.unfiltered(), type) + return super(_basefilecache, self).__get__(repo.unfiltered(), type) def __set__(self, repo, value): - return super(repofilecache, self).__set__(repo.unfiltered(), value) + return super(_basefilecache, self).__set__(repo.unfiltered(), value) def __delete__(self, repo): - return super(repofilecache, self).__delete__(repo.unfiltered()) + return super(_basefilecache, self).__delete__(repo.unfiltered()) -class storecache(repofilecache): +class repofilecache(_basefilecache): + """filecache for files in .hg but outside of .hg/store""" + def join(self, obj, fname): + return obj.vfs.join(fname) + +class storecache(_basefilecache): """filecache for files in the store""" def join(self, obj, fname): return obj.sjoin(fname)