{"thread":{"id":"21230","subject":"[PATCH] git-p4: Fixed bug that didn't allow spaces in the depot path [PATCH] git-p4: Fixed bug that didn't allow spaces in the depot path [PATCH] git-p4: Fixed bug that didn't allow spaces in the depot path","startedAt":"2009-10-13T20:09:12Z","lastAt":"2009-10-13T20:09:12Z","messageCount":1,"participants":["Per Strandh"],"isPatch":true,"patchVersion":1,"patchTotal":null},"messages":[{"id":"124883","messageId":"65D9329CA2AF94438F542D48F2A42E830F95F51514@GOT-SRV-005.QMATIC.local","threadId":"21230","inReplyTo":null,"subject":"[PATCH] git-p4: Fixed bug that didn't allow spaces in the depot path [PATCH] git-p4: Fixed bug that didn't allow spaces in the depot path [PATCH] git-p4: Fixed bug that didn't allow spaces in the depot path","fromName":"Per Strandh","fromEmail":"per.strandh@q-matic.se","sentAt":"2009-10-13T20:09:12Z","receivedAt":"2009-10-13T20:09:12Z","isPatch":true,"sender":{"key":"per.strandh@q-matic.se","avatar":null},"body":"git-p4 clone (and sync) did not work if the specified depot path contained spaces.\nFixed by quoting the argument to the \"p4 changes\" and \"p4 files\" commands.\n\nSigned-off-by: Per Strandh <per.strandh@q-matic.se>\n---\n contrib/fast-import/git-p4 |    8 ++++----\n 1 files changed, 4 insertions(+), 4 deletions(-)\n\ndiff --git a/contrib/fast-import/git-p4 b/contrib/fast-import/git-p4\nindex e710219..01b6bbb 100755\n--- a/contrib/fast-import/git-p4\n+++ b/contrib/fast-import/git-p4\n@@ -440,8 +440,8 @@ def originP4BranchesExist():\n \n def p4ChangesForPaths(depotPaths, changeRange):\n     assert depotPaths\n-    output = p4_read_pipe_lines(\"changes \" + ' '.join ([\"%s...%s\" % (p, changeRange)\n-                                                        for p in depotPaths]))\n+    output = p4_read_pipe_lines(\"changes \\\"\" + ' '.join ([\"%s...%s\" % (p, changeRange)\n+                                                        for p in depotPaths]) + \"\\\"\" )\n \n     changes = {}\n     for line in output:\n@@ -1437,10 +1437,10 @@ class P4Sync(Command):\n         newestRevision = 0\n \n         fileCnt = 0\n-        for info in p4CmdList(\"files \"\n+        for info in p4CmdList(\"files \\\"\"\n                               +  ' '.join([\"%s...%s\"\n                                            % (p, revision)\n-                                           for p in self.depotPaths])):\n+                                           for p in self.depotPaths]) + \"\\\"\"):\n \n             if info['code'] == 'error':\n                 sys.stderr.write(\"p4 returned an error: %s\\n\"\n-- \n1.6.3.msysgit.0\n\ngit-p4 clone (and sync) did not work if the specified depot path contained spaces.\nFixed by quoting the argument to the \"p4 changes\" and \"p4 files\" commands.\n\nSigned-off-by: Per Strandh <per.strandh@q-matic.se>\n---\n contrib/fast-import/git-p4 |    8 ++++----\n 1 files changed, 4 insertions(+), 4 deletions(-)\n\ndiff --git a/contrib/fast-import/git-p4 b/contrib/fast-import/git-p4\nindex e710219..01b6bbb 100755\n--- a/contrib/fast-import/git-p4\n+++ b/contrib/fast-import/git-p4\n@@ -440,8 +440,8 @@ def originP4BranchesExist():\n \n def p4ChangesForPaths(depotPaths, changeRange):\n     assert depotPaths\n-    output = p4_read_pipe_lines(\"changes \" + ' '.join ([\"%s...%s\" % (p, changeRange)\n-                                                        for p in depotPaths]))\n+    output = p4_read_pipe_lines(\"changes \\\"\" + ' '.join ([\"%s...%s\" % (p, changeRange)\n+                                                        for p in depotPaths]) + \"\\\"\" )\n \n     changes = {}\n     for line in output:\n@@ -1437,10 +1437,10 @@ class P4Sync(Command):\n         newestRevision = 0\n \n         fileCnt = 0\n-        for info in p4CmdList(\"files \"\n+        for info in p4CmdList(\"files \\\"\"\n                               +  ' '.join([\"%s...%s\"\n                                            % (p, revision)\n-                                           for p in self.depotPaths])):\n+                                           for p in self.depotPaths]) + \"\\\"\"):\n \n             if info['code'] == 'error':\n                 sys.stderr.write(\"p4 returned an error: %s\\n\"\n-- \n1.6.3.msysgit.0\n\ngit-p4 clone (and sync) did not work if the specified depot path contained spaces.\nFixed by quoting the argument to the \"p4 changes\" and \"p4 files\" commands.\n\nSigned-off-by: Per Strandh <per.strandh@q-matic.se>\n---\n contrib/fast-import/git-p4 |    8 ++++----\n 1 files changed, 4 insertions(+), 4 deletions(-)\n\ndiff --git a/contrib/fast-import/git-p4 b/contrib/fast-import/git-p4\nindex e710219..01b6bbb 100755\n--- a/contrib/fast-import/git-p4\n+++ b/contrib/fast-import/git-p4\n@@ -440,8 +440,8 @@ def originP4BranchesExist():\n \n def p4ChangesForPaths(depotPaths, changeRange):\n     assert depotPaths\n-    output = p4_read_pipe_lines(\"changes \" + ' '.join ([\"%s...%s\" % (p, changeRange)\n-                                                        for p in depotPaths]))\n+    output = p4_read_pipe_lines(\"changes \\\"\" + ' '.join ([\"%s...%s\" % (p, changeRange)\n+                                                        for p in depotPaths]) + \"\\\"\" )\n \n     changes = {}\n     for line in output:\n@@ -1437,10 +1437,10 @@ class P4Sync(Command):\n         newestRevision = 0\n \n         fileCnt = 0\n-        for info in p4CmdList(\"files \"\n+        for info in p4CmdList(\"files \\\"\"\n                               +  ' '.join([\"%s...%s\"\n                                            % (p, revision)\n-                                           for p in self.depotPaths])):\n+                                           for p in self.depotPaths]) + \"\\\"\"):\n \n             if info['code'] == 'error':\n                 sys.stderr.write(\"p4 returned an error: %s\\n\"\n-- \n1.6.3.msysgit.0\n"}]}