# HG changeset patch # User Pierre-Yves David # Date 1670044618 -3600 # Node ID 73ed1d13c0bf97cc4dabea0f2ebc97d40ac42744 # Parent 5bceea1a8234e0ae76ac0440c30716c384bd7f5b peer: get the `path` object down to the sshpeer Same logic as the other peers. diff -r 5bceea1a8234 -r 73ed1d13c0bf mercurial/sshpeer.py --- a/mercurial/sshpeer.py Sat Dec 03 06:16:45 2022 +0100 +++ b/mercurial/sshpeer.py Sat Dec 03 06:16:58 2022 +0100 @@ -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,12 +611,11 @@ 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) - urlutil.checksafessh(path) + urlutil.checksafessh(path.loc) if u.passwd is not None: raise error.RepoError(_(b'password in URL not supported'))