{"thread":{"id":"15015","subject":"[PATCH 2/2] Utilise our new p4_read_pipe and p4_write_pipe wrappers","startedAt":"2008-08-14T22:40:38Z","lastAt":"2008-08-14T22:40:39Z","messageCount":2,"participants":["Anand Kumria"],"isPatch":true,"patchVersion":1,"patchTotal":2},"messages":[{"id":"87266","messageId":"1218753639-32716-1-git-send-email-wildfire@progsoc.org","threadId":"15015","inReplyTo":"g829vo@ger.gmane.org","subject":"[PATCH 1/2] Add p4 read_pipe and write_pipe wrappers","fromName":"Anand Kumria","fromEmail":"wildfire@progsoc.org","sentAt":"2008-08-14T22:40:38Z","receivedAt":"2008-08-14T22:40:38Z","isPatch":true,"sender":{"key":"wildfire@progsoc.org","avatar":null},"body":" Two additional wrappers to cover 3 places where we utilise p4\n in piped form. Found by Tor Arvid Lund.\n\nSigned-off-by: Anand Kumria <wildfire@progsoc.org>\n---\n contrib/fast-import/git-p4 |    7 +++++++\n 1 files changed, 7 insertions(+), 0 deletions(-)\n\ndiff --git a/contrib/fast-import/git-p4 b/contrib/fast-import/git-p4\nindex 6c64224..3e9df70 100755\n--- a/contrib/fast-import/git-p4\n+++ b/contrib/fast-import/git-p4\n@@ -69,6 +69,10 @@ def write_pipe(c, str):\n \n     return val\n \n+def p4_write_pipe(c, str):\n+    real_cmd = p4_build_cmd(c)\n+    return write_pipe(c, str)\n+\n def read_pipe(c, ignore_error=False):\n     if verbose:\n         sys.stderr.write('Reading pipe: %s\\n' % c)\n@@ -80,6 +84,9 @@ def read_pipe(c, ignore_error=False):\n \n     return val\n \n+def p4_read_pipe(c, ignore_error=False):\n+    real_cmd = p4_build_cmd(c)\n+    return read_pipe(real_cmd, ignore_error)\n \n def read_pipe_lines(c):\n     if verbose:\n-- \n1.5.6.3\n"},{"id":"87263","messageId":"1218753639-32716-2-git-send-email-wildfire@progsoc.org","threadId":"15015","inReplyTo":"1218753639-32716-1-git-send-email-wildfire@progsoc.org","subject":"[PATCH 2/2] Utilise our new p4_read_pipe and p4_write_pipe wrappers","fromName":"Anand Kumria","fromEmail":"wildfire@progsoc.org","sentAt":"2008-08-14T22:40:39Z","receivedAt":"2008-08-14T22:40:39Z","isPatch":true,"sender":{"key":"wildfire@progsoc.org","avatar":null},"body":"\nSigned-off-by: Anand Kumria <wildfire@progsoc.org>\n---\n contrib/fast-import/git-p4 |    6 +++---\n 1 files changed, 3 insertions(+), 3 deletions(-)\n\ndiff --git a/contrib/fast-import/git-p4 b/contrib/fast-import/git-p4\nindex 3e9df70..12fa9d3 100755\n--- a/contrib/fast-import/git-p4\n+++ b/contrib/fast-import/git-p4\n@@ -141,7 +141,7 @@ def setP4ExecBit(file, mode):\n def getP4OpenedType(file):\n     # Returns the perforce file type for the given file.\n \n-    result = read_pipe(\"p4 opened %s\" % file)\n+    result = p4_read_pipe(\"opened %s\" % file)\n     match = re.match(\".*\\((.+)\\)\\r?$\", result)\n     if match:\n         return match.group(1)\n@@ -681,7 +681,7 @@ class P4Submit(Command):\n             submitTemplate = self.prepareLogMessage(template, logMessage)\n             if os.environ.has_key(\"P4DIFF\"):\n                 del(os.environ[\"P4DIFF\"])\n-            diff = read_pipe(\"p4 diff -du ...\")\n+            diff = p4_read_pipe(\"diff -du ...\")\n \n             newdiff = \"\"\n             for newFile in filesToAdd:\n@@ -719,7 +719,7 @@ class P4Submit(Command):\n             if self.isWindows:\n                 submitTemplate = submitTemplate.replace(\"\\r\\n\", \"\\n\")\n \n-            write_pipe(\"p4 submit -i\", submitTemplate)\n+            p4_write_pipe(\"submit -i\", submitTemplate)\n         else:\n             fileName = \"submit.txt\"\n             file = open(fileName, \"w+\")\n-- \n1.5.6.3\n"}]}