##// END OF EJS Templates
peer: pass the `path` object to `make_peer`...
marmoute -
r51037:5f71fff8 default
parent child Browse files
Show More
@@ -80,13 +80,12 b' class ShortRepository:'
80 80 def __repr__(self):
81 81 return b'<ShortRepository: %s>' % self.scheme
82 82
83 def make_peer(self, ui, url, *args, **kwargs):
84 url = self.resolve(url)
85 u = urlutil.url(url)
86 scheme = u.scheme or b'file'
87 cls = hg.peer_schemes.get(scheme)
83 def make_peer(self, ui, path, *args, **kwargs):
84 new_url = self.resolve(path.rawloc)
85 path = path.copy(new_raw_location=new_url)
86 cls = hg.peer_schemes.get(path.url.scheme)
88 87 if cls is not None:
89 return cls.make_peer(ui, url, *args, **kwargs)
88 return cls.make_peer(ui, path, *args, **kwargs)
90 89 return None
91 90
92 91 def instance(self, ui, url, create, intents=None, createopts=None):
@@ -256,7 +256,7 b' def peer(uiorrepo, opts, path, create=Fa'
256 256 cls = peer_schemes[scheme]
257 257 peer = cls.make_peer(
258 258 rui,
259 peer_path.loc,
259 peer_path,
260 260 create,
261 261 intents=intents,
262 262 createopts=createopts,
@@ -624,6 +624,7 b' def makepeer(ui, path, opener=None, requ'
624 624 def make_peer(ui, path, create, intents=None, createopts=None):
625 625 if create:
626 626 raise error.Abort(_(b'cannot create new http repository'))
627 path = path.loc
627 628 try:
628 629 if path.startswith(b'https:') and not urlmod.has_https:
629 630 raise error.Abort(
@@ -612,6 +612,7 b' def make_peer(ui, path, create, intents='
612 612
613 613 The returned object conforms to the ``wireprotov1peer.wirepeer`` interface.
614 614 """
615 path = path.loc
615 616 u = urlutil.url(path, parsequery=False, parsefragment=False)
616 617 if u.scheme != b'ssh' or not u.host or u.path is None:
617 618 raise error.RepoError(_(b"couldn't parse location %s") % path)
@@ -262,4 +262,5 b' class statichttprepository('
262 262 def make_peer(ui, path, create, intents=None, createopts=None):
263 263 if create:
264 264 raise error.Abort(_(b'cannot create new static-http repository'))
265 path = path.loc
265 266 return statichttprepository(ui, path[7:]).peer()
General Comments 0
You need to be logged in to leave comments. Login now