hgext/convert/darcs.py
changeset 5411 d5df426bd68a
parent 5362 4ad2a18aff42
child 5412 fbf40ad5a8c2
--- 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')