Skip to content
Snippets Groups Projects
Commit 320ffeb5f386 authored by Manuel Jacob's avatar Manuel Jacob
Browse files

ssh: simplify and remove obsolete compatibility code

parent f5b322889bde
No related branches found
No related tags found
1 merge request!21Make tests pass on Python 3
......@@ -17,13 +17,6 @@
class _Vendor(SSHVendor):
def run_command(self, host, command, username=None, port=None):
if isinstance(command, basestring):
# 0.12.x dulwich sends the raw string
command = [command]
elif len(command) > 1:
# 0.11.x dulwich sends an array of [command arg1 arg2 ...], so
# we detect that here and reformat it back to what hg-git
# expects (e.g. "command 'arg1 arg2'")
command = [b"%s '%s'" % (command[0], b' '.join(command[1:]))]
assert isinstance(command, basestring)
sshcmd = ui.config(b"ui", b"ssh", b"ssh")
args = compat.sshargs(sshcmd, host, username, port)
......@@ -28,7 +21,6 @@
sshcmd = ui.config(b"ui", b"ssh", b"ssh")
args = compat.sshargs(sshcmd, host, username, port)
cmd = b'%s %s %s' % (sshcmd, args,
compat.shellquote(b' '.join(command)))
cmd = b'%s %s %s' % (sshcmd, args, compat.shellquote(command))
ui.debug(b'calling ssh: %s\n' % cmd)
proc = subprocess.Popen(compat.quotecommand(cmd), shell=True,
stdin=subprocess.PIPE,
......
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