Mercurial > hg-stable
changeset 33178:edb7f628ef8b
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.
author | FUJIWARA Katsunori <foozy@lares.dti.ne.jp> |
---|---|
date | Fri, 30 Jun 2017 01:47:49 +0900 |
parents | 3b85c474cbcf |
children | be723e2afd3d |
files | mercurial/localrepo.py |
diffstat | 1 files changed, 10 insertions(+), 8 deletions(-) [+] |
line wrap: on
line diff
--- 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)