##// END OF EJS Templates
peer: get the `path` object down to the sshpeer...
marmoute -
r50656:73ed1d13 default
parent child Browse files
Show More
@@ -372,7 +372,7 b' def _performhandshake(ui, stdin, stdout,'
372 372
373 373 class sshv1peer(wireprotov1peer.wirepeer):
374 374 def __init__(
375 self, ui, url, proc, stdin, stdout, stderr, caps, autoreadstderr=True
375 self, ui, path, proc, stdin, stdout, stderr, caps, autoreadstderr=True
376 376 ):
377 377 """Create a peer from an existing SSH connection.
378 378
@@ -383,8 +383,7 b' class sshv1peer(wireprotov1peer.wirepeer'
383 383 ``autoreadstderr`` denotes whether to automatically read from
384 384 stderr and to forward its output.
385 385 """
386 super().__init__(ui)
387 self._url = url
386 super().__init__(ui, path=path)
388 387 # self._subprocess is unused. Keeping a handle on the process
389 388 # holds a reference and prevents it from being garbage collected.
390 389 self._subprocess = proc
@@ -411,7 +410,7 b' class sshv1peer(wireprotov1peer.wirepeer'
411 410 # Begin of ipeerconnection interface.
412 411
413 412 def url(self):
414 return self._url
413 return self.path.loc
415 414
416 415 def local(self):
417 416 return None
@@ -612,12 +611,11 b' def make_peer(ui, path, create, intents='
612 611
613 612 The returned object conforms to the ``wireprotov1peer.wirepeer`` interface.
614 613 """
615 path = path.loc
616 u = urlutil.url(path, parsequery=False, parsefragment=False)
614 u = urlutil.url(path.loc, parsequery=False, parsefragment=False)
617 615 if u.scheme != b'ssh' or not u.host or u.path is None:
618 616 raise error.RepoError(_(b"couldn't parse location %s") % path)
619 617
620 urlutil.checksafessh(path)
618 urlutil.checksafessh(path.loc)
621 619
622 620 if u.passwd is not None:
623 621 raise error.RepoError(_(b'password in URL not supported'))
General Comments 0
You need to be logged in to leave comments. Login now