changeset 11347:18680b0e20a7

Fix shell quoting on p4 conversion
author Frank Kingswood <frank@kingswood-consulting.co.uk>
date Mon, 14 Jun 2010 16:38:36 +0100
parents e740f36cfb4b
children ad0a334eef16
files hgext/convert/p4.py
diffstat 1 files changed, 3 insertions(+), 3 deletions(-) [+]
line wrap: on
line diff
--- a/hgext/convert/p4.py	Mon Jun 14 13:39:00 2010 -0400
+++ b/hgext/convert/p4.py	Mon Jun 14 16:38:36 2010 +0100
@@ -53,7 +53,7 @@
 
     def _parse_view(self, path):
         "Read changes affecting the path"
-        cmd = 'p4 -G changes -s submitted "%s"' % path
+        cmd = 'p4 -G changes -s submitted %s' % util.shellquote(path)
         stdout = util.popen(cmd, mode='rb')
         for d in loaditer(stdout):
             c = d.get("change", None)
@@ -72,7 +72,7 @@
             else:
                 views = {"//": ""}
         else:
-            cmd = 'p4 -G client -o "%s"' % path
+            cmd = 'p4 -G client -o %s' % util.shellquote(path)
             clientspec = marshal.load(util.popen(cmd, mode='rb'))
 
             views = {}
@@ -148,7 +148,7 @@
         return self.heads
 
     def getfile(self, name, rev):
-        cmd = 'p4 -G print "%s#%s"' % (self.depotname[name], rev)
+        cmd = 'p4 -G print %s' % util.shellquote("%s#%s"%(self.depotname[name], rev))
         stdout = util.popen(cmd, mode='rb')
 
         mode = None