Read about our upcoming Code of Conduct on this issue

This instance will be upgraded to Heptapod 0.28.0 on 2022-01-18 at 14:00 UTC+1 (a few minutes of down time)

Commit 55f5fea1 authored by Manuel Jacob's avatar Manuel Jacob
Browse files

cleanup: eliminate procutil.quotecommand()

After some compatibility code was removed, the function was the identity
function on all platforms.
parent 5258bffdb1d6
......@@ -226,8 +226,7 @@ class convert_cvs(converter_source):
cmd = [rsh, host] + cmd
# popen2 does not support argument lists under Windows
cmd = [procutil.shellquote(arg) for arg in cmd]
cmd = procutil.quotecommand(b' '.join(cmd))
cmd = b' '.join(procutil.shellquote(arg) for arg in cmd)
self.writep, self.readp = procutil.popen2(cmd)
self.realroot = root
......
......@@ -217,7 +217,7 @@ class gnuarch_source(common.converter_source, common.commandline):
cmdline = [procutil.shellquote(arg) for arg in cmdline]
bdevnull = pycompat.bytestr(os.devnull)
cmdline += [b'>', bdevnull, b'2>', bdevnull]
cmdline = procutil.quotecommand(b' '.join(cmdline))
cmdline = b' '.join(cmdline)
self.ui.debug(cmdline, b'\n')
return os.system(pycompat.rapply(procutil.tonativestr, cmdline))
......
......@@ -1235,7 +1235,7 @@ class svn_source(converter_source):
arg = encodeargs(args)
hgexe = procutil.hgexecutable()
cmd = b'%s debugsvnlog' % procutil.shellquote(hgexe)
stdin, stdout = procutil.popen2(procutil.quotecommand(cmd))
stdin, stdout = procutil.popen2(cmd)
stdin.write(arg)
try:
stdin.close()
......
......@@ -233,7 +233,6 @@ def _systembackground(cmd, environ=None, cwd=None):
''' like 'procutil.system', but returns the Popen object directly
so we don't have to wait on it.
'''
cmd = procutil.quotecommand(cmd)
env = procutil.shellenviron(environ)
proc = subprocess.Popen(
procutil.tonativestr(cmd),
......
......@@ -320,7 +320,7 @@ class channeledsystem(object):
self.channel = channel
def __call__(self, cmd, environ, cwd=None, type=b'system', cmdtable=None):
args = [type, procutil.quotecommand(cmd), os.path.abspath(cwd or b'.')]
args = [type, cmd, os.path.abspath(cwd or b'.')]
args.extend(b'%s=%s' % (k, v) for k, v in pycompat.iteritems(environ))
data = b'\0'.join(args)
self.out.write(struct.pack(b'>cI', self.channel, len(data)))
......
......@@ -538,10 +538,6 @@ def shellsplit(s):
return pycompat.shlexsplit(s, posix=True)
def quotecommand(cmd):
return cmd
def testpid(pid):
'''return False if pid dead, True if running or not sure'''
if pycompat.sysplatform == b'OpenVMS':
......
......@@ -179,7 +179,6 @@ def _makeconnection(ui, sshcmd, args, remotecmd, path, sshenv=None):
)
ui.debug(b'running %s\n' % cmd)
cmd = procutil.quotecommand(cmd)
# no buffer allow the use of 'select'
# feel free to remove buffering and select usage when we ultimately
......
......@@ -73,7 +73,6 @@ _gethgcmd = platform.gethgcmd
getuser = platform.getuser
getpid = os.getpid
hidewindow = platform.hidewindow
quotecommand = platform.quotecommand
readpipe = platform.readpipe
setbinary = platform.setbinary
setsignalhandler = platform.setsignalhandler
......@@ -138,7 +137,7 @@ def popen(cmd, mode=b'rb', bufsize=-1):
def _popenreader(cmd, bufsize):
p = subprocess.Popen(
tonativestr(quotecommand(cmd)),
tonativestr(cmd),
shell=True,
bufsize=bufsize,
close_fds=closefds,
......@@ -149,7 +148,7 @@ def _popenreader(cmd, bufsize):
def _popenwriter(cmd, bufsize):
p = subprocess.Popen(
tonativestr(quotecommand(cmd)),
tonativestr(cmd),
shell=True,
bufsize=bufsize,
close_fds=closefds,
......@@ -395,7 +394,6 @@ def system(cmd, environ=None, cwd=None, out=None):
stdout.flush()
except Exception:
pass
cmd = quotecommand(cmd)
env = shellenviron(environ)
if out is None or isstdout(out):
rc = subprocess.call(
......
......@@ -474,11 +474,6 @@ def shellsplit(s):
return pycompat.maplist(_unquote, pycompat.shlexsplit(s, posix=False))
def quotecommand(cmd):
"""Build a command string suitable for os.popen* calls."""
return cmd
# if you change this stub into a real check, please try to implement the
# username and groupname functions above, too.
def isowner(st):
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment