##// END OF EJS Templates
peer: build a `path` object on the fly when needed...
marmoute -
r50649:ec30fe69 default
parent child Browse files
Show More
@@ -244,19 +244,19 b' def repository('
244 244
245 245 def peer(uiorrepo, opts, path, create=False, intents=None, createopts=None):
246 246 '''return a repository peer for the specified path'''
247 ui = getattr(uiorrepo, 'ui', uiorrepo)
247 248 rui = remoteui(uiorrepo, opts)
248 249 if util.safehasattr(path, 'url'):
249 # this is a urlutil.path object
250 scheme = path.url.scheme # pytype: disable=attribute-error
251 # XXX for now we don't do anything more than that
252 path = path.loc # pytype: disable=attribute-error
250 # this is already a urlutil.path object
251 peer_path = path
253 252 else:
254 scheme = urlutil.url(path).scheme
253 peer_path = urlutil.path(ui, None, rawloc=path, validate_path=False)
254 scheme = peer_path.url.scheme # pytype: disable=attribute-error
255 255 if scheme in peer_schemes:
256 256 cls = peer_schemes[scheme]
257 257 peer = cls.make_peer(
258 258 rui,
259 path,
259 peer_path.loc,
260 260 create,
261 261 intents=intents,
262 262 createopts=createopts,
@@ -264,9 +264,12 b' def peer(uiorrepo, opts, path, create=Fa'
264 264 _setup_repo_or_peer(rui, peer)
265 265 else:
266 266 # this is a repository
267 repo_path = peer_path.loc # pytype: disable=attribute-error
268 if not repo_path:
269 repo_path = peer_path.rawloc # pytype: disable=attribute-error
267 270 repo = repository(
268 271 rui,
269 path,
272 repo_path,
270 273 create,
271 274 intents=intents,
272 275 createopts=createopts,
General Comments 0
You need to be logged in to leave comments. Login now