##// END OF EJS Templates
Add portable shell-quoting function; teach mq to use it.
Brendan Cully -
r2791:f4d91635 default
parent child Browse files
Show More
@@ -272,8 +272,8 b' class queue:'
272 272 patchfile: file name of patch'''
273 273 try:
274 274 pp = util.find_in_path('gpatch', os.environ.get('PATH', ''), 'patch')
275 f = os.popen("%s -d '%s' -p1 --no-backup-if-mismatch < '%s'" %
276 (pp, repo.root, patchfile))
275 f = os.popen("%s -d %s -p1 --no-backup-if-mismatch < %s" %
276 (pp, util.shellquote(repo.root), util.shellquote(patchfile)))
277 277 except:
278 278 self.ui.warn("patch failed, unable to continue (try -v)\n")
279 279 return (None, [], False)
@@ -611,6 +611,9 b" if os.name == 'nt':"
611 611 def samestat(s1, s2):
612 612 return False
613 613
614 def shellquote(s):
615 return '"%s"' % s.replace('"', '\\"')
616
614 617 def explain_exit(code):
615 618 return _("exited with status %d") % code, code
616 619
@@ -700,6 +703,9 b' else:'
700 703 else:
701 704 raise
702 705
706 def shellquote(s):
707 return "'%s'" % s.replace("'", "'\\''")
708
703 709 def testpid(pid):
704 710 '''return False if pid dead, True if running or not sure'''
705 711 try:
General Comments 0
You need to be logged in to leave comments. Login now