diff -r 23651848d638 -r 5a65d870871d mercurial/util.py --- a/mercurial/util.py Mon Sep 10 23:36:01 2007 +0200 +++ b/mercurial/util.py Mon Sep 10 23:34:33 2007 +0200 @@ -953,6 +953,12 @@ _quotere = re.compile(r'(\\*)("|\\$)') return '"%s"' % _quotere.sub(r'\1\1\\\2', s) + def quotecommand(cmd): + """Build a command string suitable for os.popen* calls.""" + # The extra quotes are needed because popen* runs the command + # through the current COMSPEC. cmd.exe suppress enclosing quotes. + return '"' + cmd + '"' + def explain_exit(code): return _("exited with status %d") % code, code @@ -1106,6 +1112,9 @@ else: return "'%s'" % s.replace("'", "'\\''") + def quotecommand(cmd): + return cmd + def testpid(pid): '''return False if pid dead, True if running or not sure''' if os.sys.platform == 'OpenVMS':