comparison mercurial/sshpeer.py @ 33763:02a745c20121

merge with stable
author Augie Fackler <augie@google.com>
date Thu, 10 Aug 2017 18:55:33 -0400
parents fda0867cfe03 8cb9e921ef8c
children 82d564d5ac4f
comparison
equal deleted inserted replaced
33762:86aca74a063b 33763:02a745c20121
122 122
123 u = util.url(path, parsequery=False, parsefragment=False) 123 u = util.url(path, parsequery=False, parsefragment=False)
124 if u.scheme != 'ssh' or not u.host or u.path is None: 124 if u.scheme != 'ssh' or not u.host or u.path is None:
125 self._abort(error.RepoError(_("couldn't parse location %s") % path)) 125 self._abort(error.RepoError(_("couldn't parse location %s") % path))
126 126
127 util.checksafessh(path)
128
127 self.user = u.user 129 self.user = u.user
128 if u.passwd is not None: 130 if u.passwd is not None:
129 self._abort(error.RepoError(_("password in URL not supported"))) 131 self._abort(error.RepoError(_("password in URL not supported")))
130 self.host = u.host 132 self.host = u.host
131 self.port = u.port 133 self.port = u.port
132 self.path = u.path or "." 134 self.path = u.path or "."
133 135
134 sshcmd = self.ui.config("ui", "ssh") 136 sshcmd = self.ui.config("ui", "ssh")
135 remotecmd = self.ui.config("ui", "remotecmd") 137 remotecmd = self.ui.config("ui", "remotecmd")
136 138
137 args = util.sshargs(sshcmd, 139 args = util.sshargs(sshcmd, self.host, self.user, self.port)
138 _serverquote(self.host),
139 _serverquote(self.user),
140 _serverquote(self.port))
141 140
142 if create: 141 if create:
143 cmd = '%s %s %s' % (sshcmd, args, 142 cmd = '%s %s %s' % (sshcmd, args,
144 util.shellquote("%s init %s" % 143 util.shellquote("%s init %s" %
145 (_serverquote(remotecmd), _serverquote(self.path)))) 144 (_serverquote(remotecmd), _serverquote(self.path))))