##// END OF EJS Templates
cleanup: eliminate procutil.quotecommand()...
Manuel Jacob -
r45403:8e8fd938 default
parent child Browse files
Show More
@@ -226,8 +226,7 b' class convert_cvs(converter_source):'
226 cmd = [rsh, host] + cmd
226 cmd = [rsh, host] + cmd
227
227
228 # popen2 does not support argument lists under Windows
228 # popen2 does not support argument lists under Windows
229 cmd = [procutil.shellquote(arg) for arg in cmd]
229 cmd = b' '.join(procutil.shellquote(arg) for arg in cmd)
230 cmd = procutil.quotecommand(b' '.join(cmd))
231 self.writep, self.readp = procutil.popen2(cmd)
230 self.writep, self.readp = procutil.popen2(cmd)
232
231
233 self.realroot = root
232 self.realroot = root
@@ -217,7 +217,7 b' class gnuarch_source(common.converter_so'
217 cmdline = [procutil.shellquote(arg) for arg in cmdline]
217 cmdline = [procutil.shellquote(arg) for arg in cmdline]
218 bdevnull = pycompat.bytestr(os.devnull)
218 bdevnull = pycompat.bytestr(os.devnull)
219 cmdline += [b'>', bdevnull, b'2>', bdevnull]
219 cmdline += [b'>', bdevnull, b'2>', bdevnull]
220 cmdline = procutil.quotecommand(b' '.join(cmdline))
220 cmdline = b' '.join(cmdline)
221 self.ui.debug(cmdline, b'\n')
221 self.ui.debug(cmdline, b'\n')
222 return os.system(pycompat.rapply(procutil.tonativestr, cmdline))
222 return os.system(pycompat.rapply(procutil.tonativestr, cmdline))
223
223
@@ -1235,7 +1235,7 b' class svn_source(converter_source):'
1235 arg = encodeargs(args)
1235 arg = encodeargs(args)
1236 hgexe = procutil.hgexecutable()
1236 hgexe = procutil.hgexecutable()
1237 cmd = b'%s debugsvnlog' % procutil.shellquote(hgexe)
1237 cmd = b'%s debugsvnlog' % procutil.shellquote(hgexe)
1238 stdin, stdout = procutil.popen2(procutil.quotecommand(cmd))
1238 stdin, stdout = procutil.popen2(cmd)
1239 stdin.write(arg)
1239 stdin.write(arg)
1240 try:
1240 try:
1241 stdin.close()
1241 stdin.close()
@@ -233,7 +233,6 b' def _systembackground(cmd, environ=None,'
233 ''' like 'procutil.system', but returns the Popen object directly
233 ''' like 'procutil.system', but returns the Popen object directly
234 so we don't have to wait on it.
234 so we don't have to wait on it.
235 '''
235 '''
236 cmd = procutil.quotecommand(cmd)
237 env = procutil.shellenviron(environ)
236 env = procutil.shellenviron(environ)
238 proc = subprocess.Popen(
237 proc = subprocess.Popen(
239 procutil.tonativestr(cmd),
238 procutil.tonativestr(cmd),
@@ -320,7 +320,7 b' class channeledsystem(object):'
320 self.channel = channel
320 self.channel = channel
321
321
322 def __call__(self, cmd, environ, cwd=None, type=b'system', cmdtable=None):
322 def __call__(self, cmd, environ, cwd=None, type=b'system', cmdtable=None):
323 args = [type, procutil.quotecommand(cmd), os.path.abspath(cwd or b'.')]
323 args = [type, cmd, os.path.abspath(cwd or b'.')]
324 args.extend(b'%s=%s' % (k, v) for k, v in pycompat.iteritems(environ))
324 args.extend(b'%s=%s' % (k, v) for k, v in pycompat.iteritems(environ))
325 data = b'\0'.join(args)
325 data = b'\0'.join(args)
326 self.out.write(struct.pack(b'>cI', self.channel, len(data)))
326 self.out.write(struct.pack(b'>cI', self.channel, len(data)))
@@ -538,10 +538,6 b' def shellsplit(s):'
538 return pycompat.shlexsplit(s, posix=True)
538 return pycompat.shlexsplit(s, posix=True)
539
539
540
540
541 def quotecommand(cmd):
542 return cmd
543
544
545 def testpid(pid):
541 def testpid(pid):
546 '''return False if pid dead, True if running or not sure'''
542 '''return False if pid dead, True if running or not sure'''
547 if pycompat.sysplatform == b'OpenVMS':
543 if pycompat.sysplatform == b'OpenVMS':
@@ -179,7 +179,6 b' def _makeconnection(ui, sshcmd, args, re'
179 )
179 )
180
180
181 ui.debug(b'running %s\n' % cmd)
181 ui.debug(b'running %s\n' % cmd)
182 cmd = procutil.quotecommand(cmd)
183
182
184 # no buffer allow the use of 'select'
183 # no buffer allow the use of 'select'
185 # feel free to remove buffering and select usage when we ultimately
184 # feel free to remove buffering and select usage when we ultimately
@@ -73,7 +73,6 b' findexe = platform.findexe'
73 getuser = platform.getuser
73 getuser = platform.getuser
74 getpid = os.getpid
74 getpid = os.getpid
75 hidewindow = platform.hidewindow
75 hidewindow = platform.hidewindow
76 quotecommand = platform.quotecommand
77 readpipe = platform.readpipe
76 readpipe = platform.readpipe
78 setbinary = platform.setbinary
77 setbinary = platform.setbinary
79 setsignalhandler = platform.setsignalhandler
78 setsignalhandler = platform.setsignalhandler
@@ -138,7 +137,7 b" def popen(cmd, mode=b'rb', bufsize=-1):"
138
137
139 def _popenreader(cmd, bufsize):
138 def _popenreader(cmd, bufsize):
140 p = subprocess.Popen(
139 p = subprocess.Popen(
141 tonativestr(quotecommand(cmd)),
140 tonativestr(cmd),
142 shell=True,
141 shell=True,
143 bufsize=bufsize,
142 bufsize=bufsize,
144 close_fds=closefds,
143 close_fds=closefds,
@@ -149,7 +148,7 b' def _popenreader(cmd, bufsize):'
149
148
150 def _popenwriter(cmd, bufsize):
149 def _popenwriter(cmd, bufsize):
151 p = subprocess.Popen(
150 p = subprocess.Popen(
152 tonativestr(quotecommand(cmd)),
151 tonativestr(cmd),
153 shell=True,
152 shell=True,
154 bufsize=bufsize,
153 bufsize=bufsize,
155 close_fds=closefds,
154 close_fds=closefds,
@@ -395,7 +394,6 b' def system(cmd, environ=None, cwd=None, '
395 stdout.flush()
394 stdout.flush()
396 except Exception:
395 except Exception:
397 pass
396 pass
398 cmd = quotecommand(cmd)
399 env = shellenviron(environ)
397 env = shellenviron(environ)
400 if out is None or isstdout(out):
398 if out is None or isstdout(out):
401 rc = subprocess.call(
399 rc = subprocess.call(
@@ -474,11 +474,6 b' def shellsplit(s):'
474 return pycompat.maplist(_unquote, pycompat.shlexsplit(s, posix=False))
474 return pycompat.maplist(_unquote, pycompat.shlexsplit(s, posix=False))
475
475
476
476
477 def quotecommand(cmd):
478 """Build a command string suitable for os.popen* calls."""
479 return cmd
480
481
482 # if you change this stub into a real check, please try to implement the
477 # if you change this stub into a real check, please try to implement the
483 # username and groupname functions above, too.
478 # username and groupname functions above, too.
484 def isowner(st):
479 def isowner(st):
General Comments 0
You need to be logged in to leave comments. Login now