DORMANTno replies

[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

From: Per Strandh <hidden>
Date: 2016-06-15 22:47:32
Subsystem: the rest · Maintainer: Linus Torvalds

git-p4 clone (and sync) did not work if the specified depot path contained spaces.
Fixed by quoting the argument to the "p4 changes" and "p4 files" commands.

Signed-off-by: Per Strandh <redacted>
---
 contrib/fast-import/git-p4 |    8 ++++----
 1 files changed, 4 insertions(+), 4 deletions(-)
diff --git a/contrib/fast-import/git-p4 b/contrib/fast-import/git-p4
index e710219..01b6bbb 100755
--- a/contrib/fast-import/git-p4
+++ b/contrib/fast-import/git-p4
@@ -440,8 +440,8 @@ def originP4BranchesExist():
 
 def p4ChangesForPaths(depotPaths, changeRange):
     assert depotPaths
-    output = p4_read_pipe_lines("changes " + ' '.join (["%s...%s" % (p, changeRange)
-                                                        for p in depotPaths]))
+    output = p4_read_pipe_lines("changes \"" + ' '.join (["%s...%s" % (p, changeRange)
+                                                        for p in depotPaths]) + "\"" )
 
     changes = {}
     for line in output:
@@ -1437,10 +1437,10 @@ class P4Sync(Command):
         newestRevision = 0
 
         fileCnt = 0
-        for info in p4CmdList("files "
+        for info in p4CmdList("files \""
                               +  ' '.join(["%s...%s"
                                            % (p, revision)
-                                           for p in self.depotPaths])):
+                                           for p in self.depotPaths]) + "\""):
 
             if info['code'] == 'error':
                 sys.stderr.write("p4 returned an error: %s\n"
-- 
1.6.3.msysgit.0

git-p4 clone (and sync) did not work if the specified depot path contained spaces.
Fixed by quoting the argument to the "p4 changes" and "p4 files" commands.

Signed-off-by: Per Strandh <per.strandh@q-matic.se>
---
 contrib/fast-import/git-p4 |    8 ++++----
 1 files changed, 4 insertions(+), 4 deletions(-)

diff --git a/contrib/fast-import/git-p4 b/contrib/fast-import/git-p4
index e710219..01b6bbb 100755
--- a/contrib/fast-import/git-p4
+++ b/contrib/fast-import/git-p4
@@ -440,8 +440,8 @@ def originP4BranchesExist():
 
 def p4ChangesForPaths(depotPaths, changeRange):
     assert depotPaths
-    output = p4_read_pipe_lines("changes " + ' '.join (["%s...%s" % (p, changeRange)
-                                                        for p in depotPaths]))
+    output = p4_read_pipe_lines("changes \"" + ' '.join (["%s...%s" % (p, changeRange)
+                                                        for p in depotPaths]) + "\"" )
 
     changes = {}
     for line in output:
@@ -1437,10 +1437,10 @@ class P4Sync(Command):
         newestRevision = 0
 
         fileCnt = 0
-        for info in p4CmdList("files "
+        for info in p4CmdList("files \""
                               +  ' '.join(["%s...%s"
                                            % (p, revision)
-                                           for p in self.depotPaths])):
+                                           for p in self.depotPaths]) + "\""):
 
             if info['code'] == 'error':
                 sys.stderr.write("p4 returned an error: %s\n"
-- 
1.6.3.msysgit.0

git-p4 clone (and sync) did not work if the specified depot path contained spaces.
Fixed by quoting the argument to the "p4 changes" and "p4 files" commands.

Signed-off-by: Per Strandh <per.strandh@q-matic.se>
---
 contrib/fast-import/git-p4 |    8 ++++----
 1 files changed, 4 insertions(+), 4 deletions(-)

diff --git a/contrib/fast-import/git-p4 b/contrib/fast-import/git-p4
index e710219..01b6bbb 100755
--- a/contrib/fast-import/git-p4
+++ b/contrib/fast-import/git-p4
@@ -440,8 +440,8 @@ def originP4BranchesExist():
 
 def p4ChangesForPaths(depotPaths, changeRange):
     assert depotPaths
-    output = p4_read_pipe_lines("changes " + ' '.join (["%s...%s" % (p, changeRange)
-                                                        for p in depotPaths]))
+    output = p4_read_pipe_lines("changes \"" + ' '.join (["%s...%s" % (p, changeRange)
+                                                        for p in depotPaths]) + "\"" )
 
     changes = {}
     for line in output:
@@ -1437,10 +1437,10 @@ class P4Sync(Command):
         newestRevision = 0
 
         fileCnt = 0
-        for info in p4CmdList("files "
+        for info in p4CmdList("files \""
                               +  ' '.join(["%s...%s"
                                            % (p, revision)
-                                           for p in self.depotPaths])):
+                                           for p in self.depotPaths]) + "\""):
 
             if info['code'] == 'error':
                 sys.stderr.write("p4 returned an error: %s\n"
-- 
1.6.3.msysgit.0
Keyboard shortcuts
hback out one level
jnext message in thread
kprevious message in thread
ldrill in
Escclose help / fold thread tree
?toggle this help