comparison mercurial/localrepo.py @ 29104:b207653ada10

localrepo: remove a couple of local type aliases The local aliases are unused now, and were confusing mypy's type checker.
author Augie Fackler <augie@google.com>
date Fri, 06 May 2016 11:31:29 -0400
parents 3f0177d2b8fb
children e0fc0ed41935
comparison
equal deleted inserted replaced
29103:f2aa1c3e7e77 29104:b207653ada10
55 transaction, 55 transaction,
56 util, 56 util,
57 ) 57 )
58 58
59 release = lockmod.release 59 release = lockmod.release
60 propertycache = util.propertycache
61 urlerr = util.urlerr 60 urlerr = util.urlerr
62 urlreq = util.urlreq 61 urlreq = util.urlreq
63 filecache = scmutil.filecache 62
64 63 class repofilecache(scmutil.filecache):
65 class repofilecache(filecache):
66 """All filecache usage on repo are done for logic that should be unfiltered 64 """All filecache usage on repo are done for logic that should be unfiltered
67 """ 65 """
68 66
69 def __get__(self, repo, type=None): 67 def __get__(self, repo, type=None):
70 return super(repofilecache, self).__get__(repo.unfiltered(), type) 68 return super(repofilecache, self).__get__(repo.unfiltered(), type)
76 class storecache(repofilecache): 74 class storecache(repofilecache):
77 """filecache for files in the store""" 75 """filecache for files in the store"""
78 def join(self, obj, fname): 76 def join(self, obj, fname):
79 return obj.sjoin(fname) 77 return obj.sjoin(fname)
80 78
81 class unfilteredpropertycache(propertycache): 79 class unfilteredpropertycache(util.propertycache):
82 """propertycache that apply to unfiltered repo only""" 80 """propertycache that apply to unfiltered repo only"""
83 81
84 def __get__(self, repo, type=None): 82 def __get__(self, repo, type=None):
85 unfi = repo.unfiltered() 83 unfi = repo.unfiltered()
86 if unfi is repo: 84 if unfi is repo:
87 return super(unfilteredpropertycache, self).__get__(unfi) 85 return super(unfilteredpropertycache, self).__get__(unfi)
88 return getattr(unfi, self.name) 86 return getattr(unfi, self.name)
89 87
90 class filteredpropertycache(propertycache): 88 class filteredpropertycache(util.propertycache):
91 """propertycache that must take filtering in account""" 89 """propertycache that must take filtering in account"""
92 90
93 def cachevalue(self, obj, value): 91 def cachevalue(self, obj, value):
94 object.__setattr__(obj, self.name, value) 92 object.__setattr__(obj, self.name, value)
95 93