##// END OF EJS Templates
patchbomb: use procutil.shellquote() instead of shlex to escape email address...
Yuya Nishihara -
r43366:813aa8cc default
parent child Browse files
Show More
@@ -168,9 +168,10 b' def _smtp(ui):'
168 def _sendmail(ui, sender, recipients, msg):
168 def _sendmail(ui, sender, recipients, msg):
169 '''send mail using sendmail.'''
169 '''send mail using sendmail.'''
170 program = ui.config(b'email', b'method')
170 program = ui.config(b'email', b'method')
171 stremail = lambda x: (
171
172 procutil.quote(stringutil.email(encoding.strtolocal(x)))
172 def stremail(x):
173 )
173 return procutil.shellquote(stringutil.email(encoding.strtolocal(x)))
174
174 cmdline = b'%s -f %s %s' % (
175 cmdline = b'%s -f %s %s' % (
175 program,
176 program,
176 stremail(sender),
177 stremail(sender),
@@ -337,11 +337,9 b' if ispy3:'
337 ret = shlex.split(s.decode('latin-1'), comments, posix)
337 ret = shlex.split(s.decode('latin-1'), comments, posix)
338 return [a.encode('latin-1') for a in ret]
338 return [a.encode('latin-1') for a in ret]
339
339
340 shlexquote = shlex.quote
341
340
342 else:
341 else:
343 import cStringIO
342 import cStringIO
344 import pipes
345
343
346 xrange = xrange
344 xrange = xrange
347 unicode = unicode
345 unicode = unicode
@@ -408,7 +406,6 b' else:'
408 sysplatform = sys.platform
406 sysplatform = sys.platform
409 sysexecutable = sys.executable
407 sysexecutable = sys.executable
410 shlexsplit = shlex.split
408 shlexsplit = shlex.split
411 shlexquote = pipes.quote
412 bytesio = cStringIO.StringIO
409 bytesio = cStringIO.StringIO
413 stringio = bytesio
410 stringio = bytesio
414 maplist = map
411 maplist = map
@@ -77,7 +77,6 b' shellsplit = platform.shellsplit'
77 spawndetached = platform.spawndetached
77 spawndetached = platform.spawndetached
78 sshargs = platform.sshargs
78 sshargs = platform.sshargs
79 testpid = platform.testpid
79 testpid = platform.testpid
80 quote = pycompat.shlexquote
81
80
82 try:
81 try:
83 setprocname = osutil.setprocname
82 setprocname = osutil.setprocname
General Comments 0
You need to be logged in to leave comments. Login now