Skip to content
Snippets Groups Projects
Commit 73ed1d13 authored by Pierre-Yves David's avatar Pierre-Yves David :octopus:
Browse files

peer: get the `path` object down to the sshpeer

Same logic as the other peers.
parent 5bceea1a
No related branches found
No related tags found
3 merge requests!485branching: merge default into stable,!340store the `path` object on the `peer` object.,!305Add option to relax the delta chain constraint during pull
......@@ -372,7 +372,7 @@
class sshv1peer(wireprotov1peer.wirepeer):
def __init__(
self, ui, url, proc, stdin, stdout, stderr, caps, autoreadstderr=True
self, ui, path, proc, stdin, stdout, stderr, caps, autoreadstderr=True
):
"""Create a peer from an existing SSH connection.
......@@ -383,8 +383,7 @@
``autoreadstderr`` denotes whether to automatically read from
stderr and to forward its output.
"""
super().__init__(ui)
self._url = url
super().__init__(ui, path=path)
# self._subprocess is unused. Keeping a handle on the process
# holds a reference and prevents it from being garbage collected.
self._subprocess = proc
......@@ -411,7 +410,7 @@
# Begin of ipeerconnection interface.
def url(self):
return self._url
return self.path.loc
def local(self):
return None
......@@ -612,8 +611,7 @@
The returned object conforms to the ``wireprotov1peer.wirepeer`` interface.
"""
path = path.loc
u = urlutil.url(path, parsequery=False, parsefragment=False)
u = urlutil.url(path.loc, parsequery=False, parsefragment=False)
if u.scheme != b'ssh' or not u.host or u.path is None:
raise error.RepoError(_(b"couldn't parse location %s") % path)
......@@ -617,7 +615,7 @@
if u.scheme != b'ssh' or not u.host or u.path is None:
raise error.RepoError(_(b"couldn't parse location %s") % path)
urlutil.checksafessh(path)
urlutil.checksafessh(path.loc)
if u.passwd is not None:
raise error.RepoError(_(b'password in URL not supported'))
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment