On 09/09/12 21:16, Pete Wyckoff wrote:
When editing the submit template, if no change was made to it,
git p4 offers a prompt "Submit anyway?".  Answering "no" cancels
the submit.

Previously, a "no" answer behaves like a "[s]kip" answer to the
failed-patch prompt, in that it proceeded to try to apply the
rest of the commits.  Instead, put users back into the new
"[s]kip / [c]ontinue" loop so that they can decide.  This makes
both cases of patch failure behave identically.

The return code of git p4 after a "no" answer is now the same
as that for a "skip" due to failed patch; update a test to
understand this.

Signed-off-by: Pete Wyckoff<>
---                          | 4 +++-
  t/ | 2 +-
  2 files changed, 4 insertions(+), 2 deletions(-)

diff --git a/ b/
index 479f1fc..39fa2e1 100755
--- a/
+++ b/
@@ -1262,6 +1262,7 @@ class P4Submit(Command, P4UserMap):

          if self.edit_template(fileName):
              # read the edited message and submit
+            ret = True
              tmpFile = open(fileName, "rb")
              message =
@@ -1285,6 +1286,7 @@ class P4Submit(Command, P4UserMap):

              # skip this patch
+            ret = False
              print "Submission cancelled, undoing p4 changes."
              for f in editedFiles:
@@ -1293,7 +1295,7 @@ class P4Submit(Command, P4UserMap):

-        return True  # success
+        return ret

      # Export git tags as p4 labels. Create a p4 label and then tag
      # with that.
diff --git a/t/ 
index fb3c8ec..ff2cc79 100755
--- a/t/
+++ b/t/
@@ -38,7 +38,7 @@ test_expect_success 'no config, unedited, say no' '
                cd "$git"&&
                echo line>>file1&&
                git commit -a -m "change 3 (not really)"&&
-               printf "bad response\nn\n" | git p4 submit&&
+               printf "bad response\nn\n" | test_expect_code 1 git p4 submit&&
                p4 changes //depot/...>wc&&
                test_line_count = 2 wc

To unsubscribe from this list: send the line "unsubscribe git" in
the body of a message to
More majordomo info at

Reply via email to