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