mercurial/util.py
changeset 2791 f4d916351366
parent 2760 e6bef16b6cec
child 2793 1e8b8107a2c9
--- a/mercurial/util.py	Sun Aug 06 16:03:02 2006 +0200
+++ b/mercurial/util.py	Sat Aug 05 15:23:26 2006 -0700
@@ -611,6 +611,9 @@
     def samestat(s1, s2):
         return False
 
+    def shellquote(s):
+        return '"%s"' % s.replace('"', '\\"')
+
     def explain_exit(code):
         return _("exited with status %d") % code, code
 
@@ -700,6 +703,9 @@
             else:
                 raise
 
+    def shellquote(s):
+        return "'%s'" % s.replace("'", "'\\''")
+
     def testpid(pid):
         '''return False if pid dead, True if running or not sure'''
         try: