Fix shell quoting on p4 conversion
authorFrank Kingswood <frank@kingswood-consulting.co.uk>
Mon, 14 Jun 2010 16:38:36 +0100
changeset 11347 18680b0e20a7
parent 11346 e740f36cfb4b
child 11348 ad0a334eef16
Fix shell quoting on p4 conversion
hgext/convert/p4.py
--- 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