##// END OF EJS Templates
peer-or-repo: move the object setup in its own function...
marmoute -
r50579:1e6c3736 default
parent child Browse files
Show More
@@ -181,9 +181,13 b' def _peerorrepo('
181 181 ui, path, create=False, presetupfuncs=None, intents=None, createopts=None
182 182 ):
183 183 """return a repository object for the specified path"""
184 obj = _peerlookup(path).instance(
185 ui, path, create, intents=intents, createopts=createopts
186 )
184 cls = _peerlookup(path)
185 obj = cls.instance(ui, path, create, intents=intents, createopts=createopts)
186 _setup_repo_or_peer(ui, obj, presetupfuncs)
187 return obj
188
189
190 def _setup_repo_or_peer(ui, obj, presetupfuncs=None):
187 191 ui = getattr(obj, "ui", ui)
188 192 for f in presetupfuncs or []:
189 193 f(ui, obj)
@@ -195,14 +199,12 b' def _peerorrepo('
195 199 if hook:
196 200 with util.timedcm('reposetup %r', name) as stats:
197 201 hook(ui, obj)
198 ui.log(
199 b'extension', b' > reposetup for %s took %s\n', name, stats
200 )
202 msg = b' > reposetup for %s took %s\n'
203 ui.log(b'extension', msg, name, stats)
201 204 ui.log(b'extension', b'> all reposetup took %s\n', allreposetupstats)
202 205 if not obj.local():
203 206 for f in wirepeersetupfuncs:
204 207 f(ui, obj)
205 return obj
206 208
207 209
208 210 def repository(
General Comments 0
You need to be logged in to leave comments. Login now