git p4: remove submit failure options [a]pply and [w]rite

When a patch failed to apply, these interactive options offered to: 1) apply the patch anyway, leaving reject (.rej) files around, or, 2) write the patch to a file (patch.txt) In both cases it suggested to invoke "git p4 submit --continue", an unimplemented option. While manually fixing the rejects and submitting the result might work, there are many steps that must be done to the job properly: * apply patch * invoke p4 add and delete * change executable bits * p4 sync -f renamed/copied files * extract commit message into p4 change description and move Jobs lines out of description section * set changelist owner for --preserve-user Plus the following manual sync/rebase will cause conflicts too, which must be resolved once again. Drop these workflows. Instead users should do a sync/rebase in git, fix the conflicts there, and do a clean "git p4 submit". Signed-off-by: Pete Wyckoff <pw@padd.com> Acked-by: Luke Diamand <luke@diamand.org> Signed-off-by: Junio C Hamano <gitster@pobox.com>

Pete Wyckoff committed Sep 9, 2012 at 16:16 UTC 449bb9cf1a0c42ddf6e9b9b6fd447eda12f9bc92
1 file changed +2 -18
git-p4.py
+2 -18
@@ -1200,9 +1200,8 @@ class P4Submit(Command, P4UserMap):
1200 if not patch_succeeded:
1201 print "What do you want to do?"
1202 response = "x"
1203 - while response != "s" and response != "a" and response != "w":
1204 - response = raw_input("[s]kip this patch / [a]pply the patch forcibly "
1205 - "and with .rej files / [w]rite the patch to a file (patch.txt) ")
1203 + while response != "s":
1204 + response = raw_input("[s]kip this patch ")
1205 if response == "s":
1206 print "Skipping! Good luck with the next patches..."
1207 for f in editedFiles:
@@ -1210,21 +1209,6 @@ class P4Submit(Command, P4UserMap):
1209 for f in filesToAdd:
1210 os.remove(f)
1211 return False
1213 - elif response == "a":
1214 - os.system(applyPatchCmd)
1215 - if len(filesToAdd) > 0:
1216 - print "You may also want to call p4 add on the following files:"
1217 - print " ".join(filesToAdd)
1218 - if len(filesToDelete):
1219 - print "The following files should be scheduled for deletion with p4 delete:"
1220 - print " ".join(filesToDelete)
1221 - die("Please resolve and submit the conflict manually and "
1222 - + "continue afterwards with git p4 submit --continue")
1223 - elif response == "w":
1224 - system(diffcmd + " > patch.txt")
1225 - print "Patch saved to patch.txt in %s !" % self.clientPath
1226 - die("Please resolve and submit the conflict manually and "
1227 - "continue afterwards with git p4 submit --continue")
1212
1213 system(applyPatchCmd)
1214