diff mercurial/sshpeer.py @ 37123:a8a902d7176e

procutil: bulk-replace function calls to point to new module
author Yuya Nishihara <yuya@tcha.org>
date Sat, 24 Mar 2018 15:10:51 +0900
parents 46f4d71ed505
children 39f7d4ee8bcd
line wrap: on
line diff
--- a/mercurial/sshpeer.py	Sat Mar 24 15:09:33 2018 +0900
+++ b/mercurial/sshpeer.py	Sat Mar 24 15:10:51 2018 +0900
@@ -19,6 +19,9 @@
     wireprotoserver,
     wireprototypes,
 )
+from .utils import (
+    procutil,
+)
 
 def _serverquote(s):
     """quote a string for the remote shell ... which we assume is sh"""
@@ -33,7 +36,7 @@
 
     This is non blocking."""
     if pipe:
-        s = util.readpipe(pipe)
+        s = procutil.readpipe(pipe)
         if s:
             for l in s.splitlines():
                 ui.status(_("remote: "), l, '\n')
@@ -147,16 +150,16 @@
     cmd = '%s %s %s' % (
         sshcmd,
         args,
-        util.shellquote('%s -R %s serve --stdio' % (
+        procutil.shellquote('%s -R %s serve --stdio' % (
             _serverquote(remotecmd), _serverquote(path))))
 
     ui.debug('running %s\n' % cmd)
-    cmd = util.quotecommand(cmd)
+    cmd = procutil.quotecommand(cmd)
 
     # no buffer allow the use of 'select'
     # feel free to remove buffering and select usage when we ultimately
     # move to threading.
-    stdin, stdout, stderr, proc = util.popen4(cmd, bufsize=0, env=sshenv)
+    stdin, stdout, stderr, proc = procutil.popen4(cmd, bufsize=0, env=sshenv)
 
     return proc, stdin, stdout, stderr
 
@@ -593,14 +596,14 @@
     sshcmd = ui.config('ui', 'ssh')
     remotecmd = ui.config('ui', 'remotecmd')
     sshaddenv = dict(ui.configitems('sshenv'))
-    sshenv = util.shellenviron(sshaddenv)
+    sshenv = procutil.shellenviron(sshaddenv)
     remotepath = u.path or '.'
 
-    args = util.sshargs(sshcmd, u.host, u.user, u.port)
+    args = procutil.sshargs(sshcmd, u.host, u.user, u.port)
 
     if create:
         cmd = '%s %s %s' % (sshcmd, args,
-            util.shellquote('%s init %s' %
+            procutil.shellquote('%s init %s' %
                 (_serverquote(remotecmd), _serverquote(remotepath))))
         ui.debug('running %s\n' % cmd)
         res = ui.system(cmd, blockedtag='sshpeer', environ=sshenv)