diff hggit/_ssh.py @ 1130:80664524802b

compat: add compatibility for 4.6 mercurial.utils
author Sean Farley <sean@farley.io>
date Thu, 24 May 2018 11:26:15 +0200
parents 8ed6c0cae9b8
children
line wrap: on
line diff
--- a/hggit/_ssh.py	Thu May 24 09:50:04 2018 +0200
+++ b/hggit/_ssh.py	Thu May 24 11:26:15 2018 +0200
@@ -1,9 +1,6 @@
 from dulwich.client import SubprocessWrapper
 import subprocess
-
-from mercurial import (
-    util,
-)
+import compat
 
 
 class SSHVendor(object):
@@ -27,11 +24,11 @@
                 # expects (e.g. "command 'arg1 arg2'")
                 command = ["%s '%s'" % (command[0], ' '.join(command[1:]))]
             sshcmd = ui.config("ui", "ssh", "ssh")
-            args = util.sshargs(sshcmd, host, username, port)
+            args = compat.sshargs(sshcmd, host, username, port)
             cmd = '%s %s %s' % (sshcmd, args,
-                                util.shellquote(' '.join(command)))
+                                compat.shellquote(' '.join(command)))
             ui.debug('calling ssh: %s\n' % cmd)
-            proc = subprocess.Popen(util.quotecommand(cmd), shell=True,
+            proc = subprocess.Popen(compat.quotecommand(cmd), shell=True,
                                     stdin=subprocess.PIPE,
                                     stdout=subprocess.PIPE)
             return SubprocessWrapper(proc)