diff options
author | Pete Wyckoff <pw@padd.com> | 2012-09-09 16:16:06 -0400 |
---|---|---|
committer | Junio C Hamano <gitster@pobox.com> | 2012-09-16 21:52:52 -0700 |
commit | 5a41c16a81927bbccbcb00895b168a6d560b8c2c (patch) | |
tree | e6c01bfc94665eef12eebf6b915f595bfcbdf694 /git-p4.py | |
parent | 7e5dd9f2ccf2141d65e4621b765a136796b0d55b (diff) | |
download | git-5a41c16a81927bbccbcb00895b168a6d560b8c2c.tar.gz |
git p4: standardize submit cancel due to unchanged template
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 <pw@padd.com>
Acked-by: Luke Diamand <luke@diamand.org>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
Diffstat (limited to 'git-p4.py')
-rwxr-xr-x | git-p4.py | 4 |
1 files changed, 3 insertions, 1 deletions
@@ -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 = tmpFile.read() tmpFile.close() @@ -1285,6 +1286,7 @@ class P4Submit(Command, P4UserMap): else: # skip this patch + ret = False print "Submission cancelled, undoing p4 changes." for f in editedFiles: p4_revert(f) @@ -1293,7 +1295,7 @@ class P4Submit(Command, P4UserMap): os.remove(f) os.remove(fileName) - return True # success + return ret # Export git tags as p4 labels. Create a p4 label and then tag # with that. |