##// END OF EJS Templates
caches: use region conf from base class
marcink -
r752:a6de52aa default
parent child Browse files
Show More
@@ -140,7 +140,6 b' class GitRemote(RemoteBase):'
140 "parents": self.parents,
140 "parents": self.parents,
141 "_commit": self.revision,
141 "_commit": self.revision,
142 }
142 }
143 self.region = self._factory._cache_region
144
143
145 def _wire_to_config(self, wire):
144 def _wire_to_config(self, wire):
146 if 'config' in wire:
145 if 'config' in wire:
@@ -169,7 +169,6 b' class HgRemote(RemoteBase):'
169 "hidden": self.ctx_hidden,
169 "hidden": self.ctx_hidden,
170 "_file_paths": self.ctx_list,
170 "_file_paths": self.ctx_list,
171 }
171 }
172 self.region = self._factory._cache_region
173
172
174 def _get_ctx(self, repo, ref):
173 def _get_ctx(self, repo, ref):
175 return get_ctx(repo, ref)
174 return get_ctx(repo, ref)
@@ -652,6 +651,7 b' class HgRemote(RemoteBase):'
652 @reraise_safe_exceptions
651 @reraise_safe_exceptions
653 def rev_range(self, wire, commit_filter):
652 def rev_range(self, wire, commit_filter):
654 cache_on, context_uid, repo_id = self._cache_on(wire)
653 cache_on, context_uid, repo_id = self._cache_on(wire)
654
655 @self.region.conditional_cache_on_arguments(condition=cache_on)
655 @self.region.conditional_cache_on_arguments(condition=cache_on)
656 def _rev_range(_context_uid, _repo_id, _filter):
656 def _rev_range(_context_uid, _repo_id, _filter):
657 repo = self._factory.repo(wire)
657 repo = self._factory.repo(wire)
@@ -115,7 +115,6 b' class SvnRemote(RemoteBase):'
115 # TODO: Remove once we do not use internal Mercurial objects anymore
115 # TODO: Remove once we do not use internal Mercurial objects anymore
116 # for subversion
116 # for subversion
117 self._hg_factory = hg_factory
117 self._hg_factory = hg_factory
118 self.region = self._factory._cache_region
119
118
120 @reraise_safe_exceptions
119 @reraise_safe_exceptions
121 def discover_svn_version(self):
120 def discover_svn_version(self):
@@ -19,6 +19,10 b''
19 class RemoteBase(object):
19 class RemoteBase(object):
20 EMPTY_COMMIT = '0' * 40
20 EMPTY_COMMIT = '0' * 40
21
21
22 @property
23 def region(self):
24 return self._factory._cache_region
25
22 def _cache_on(self, wire):
26 def _cache_on(self, wire):
23 context = wire.get('context', '')
27 context = wire.get('context', '')
24 context_uid = '{}'.format(context)
28 context_uid = '{}'.format(context)
General Comments 0
You need to be logged in to leave comments. Login now