188 return url.open(ui, path, sendaccept=sendaccept) |
188 return url.open(ui, path, sendaccept=sendaccept) |
189 |
189 |
190 |
190 |
191 # a list of (ui, repo) functions called for wire peer initialization |
191 # a list of (ui, repo) functions called for wire peer initialization |
192 wirepeersetupfuncs = [] |
192 wirepeersetupfuncs = [] |
193 |
|
194 |
|
195 def _peerorrepo( |
|
196 ui, path, create=False, presetupfuncs=None, intents=None, createopts=None |
|
197 ): |
|
198 """return a repository object for the specified path""" |
|
199 cls = _peerlookup(path) |
|
200 obj = cls.instance(ui, path, create, intents=intents, createopts=createopts) |
|
201 _setup_repo_or_peer(ui, obj, presetupfuncs) |
|
202 return obj |
|
203 |
193 |
204 |
194 |
205 def _setup_repo_or_peer(ui, obj, presetupfuncs=None): |
195 def _setup_repo_or_peer(ui, obj, presetupfuncs=None): |
206 ui = getattr(obj, "ui", ui) |
196 ui = getattr(obj, "ui", ui) |
207 for f in presetupfuncs or []: |
197 for f in presetupfuncs or []: |