convert: fix darcs_source._run() under windows
authorPatrick Mezard <pmezard@gmail.com>
Sun, 07 Oct 2007 18:58:54 +0200
changeset 5411 d5df426bd68a
parent 5410 2daecf3d2582
child 5412 fbf40ad5a8c2
convert: fix darcs_source._run() under windows
hgext/convert/darcs.py
--- a/hgext/convert/darcs.py	Sun Oct 07 18:58:44 2007 +0200
+++ b/hgext/convert/darcs.py	Sun Oct 07 18:58:54 2007 +0200
@@ -61,8 +61,11 @@
         shutil.rmtree(self.tmppath, ignore_errors=True)
 
     def _run(self, cmd, *args, **kwargs):
-        cmdline = 'darcs %s --repodir=%r %s </dev/null' % (
-            cmd, kwargs.get('repodir', self.path), ' '.join(args))
+        cmdline = ['darcs', cmd, '--repodir', kwargs.get('repodir', self.path)]
+        cmdline += args
+        cmdline = [util.shellquote(arg) for arg in cmdline]
+        cmdline += ['<', util.nulldev]
+        cmdline = util.quotecommand(' '.join(cmdline))
         self.ui.debug(cmdline, '\n')
         return os.popen(cmdline, 'r')