merge with stable
authorSteve Borho <steve@borho.org>
Thu, 23 Dec 2010 13:23:20 -0600
changeset 13189 f5be619663f9
parent 13187 e3b87fb34d00 (current diff)
parent 13188 6c9345f9edca (diff)
child 13190 5314cbb775f6
merge with stable
mercurial/util.py
--- a/mercurial/util.py	Wed Dec 22 13:16:03 2010 -0600
+++ b/mercurial/util.py	Thu Dec 23 13:23:20 2010 -0600
@@ -391,9 +391,7 @@
             return '1'
         return str(val)
     origcmd = cmd
-    if os.name == 'nt' and sys.version_info < (2, 7, 1):
-        # Python versions since 2.7.1 do this extra quoting themselves
-        cmd = '"%s"' % cmd
+    cmd = quotecommand(cmd)
     env = dict(os.environ)
     env.update((k, py2shell(v)) for k, v in environ.iteritems())
     env['HG'] = hgexecutable()
--- a/mercurial/windows.py	Wed Dec 22 13:16:03 2010 -0600
+++ b/mercurial/windows.py	Thu Dec 23 13:23:20 2010 -0600
@@ -160,9 +160,10 @@
 
 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 + '"'
+    if sys.version_info < (2, 7, 1):
+        # Python versions since 2.7.1 do this extra quoting themselves
+        return '"' + cmd + '"'
+    return cmd
 
 def popen(command, mode='r'):
     # Work around "popen spawned process may not write to stdout