git p4: remove submit failure options [a]pply and [w]rite
authorPete Wyckoff <pw@padd.com>
Sun, 9 Sep 2012 20:16:04 +0000 (16:16 -0400)
committerJunio C Hamano <gitster@pobox.com>
Mon, 17 Sep 2012 04:52:52 +0000 (21:52 -0700)
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>
git-p4.py
index 2405f383e1907a2d36edcb018fd9a5c654c31b80..e08fea18d22dff4f98e996900b6d49df67973e1c 100755 (executable)
--- a/git-p4.py
+++ b/git-p4.py
@@ -1200,9 +1200,8 @@ def applyCommit(self, id):
         if not patch_succeeded:
             print "What do you want to do?"
             response = "x"
-            while response != "s" and response != "a" and response != "w":
-                response = raw_input("[s]kip this patch / [a]pply the patch forcibly "
-                                     "and with .rej files / [w]rite the patch to a file (patch.txt) ")
+            while response != "s":
+                response = raw_input("[s]kip this patch ")
             if response == "s":
                 print "Skipping! Good luck with the next patches..."
                 for f in editedFiles:
@@ -1210,21 +1209,6 @@ def applyCommit(self, id):
                 for f in filesToAdd:
                     os.remove(f)
                 return False
-            elif response == "a":
-                os.system(applyPatchCmd)
-                if len(filesToAdd) > 0:
-                    print "You may also want to call p4 add on the following files:"
-                    print " ".join(filesToAdd)
-                if len(filesToDelete):
-                    print "The following files should be scheduled for deletion with p4 delete:"
-                    print " ".join(filesToDelete)
-                die("Please resolve and submit the conflict manually and "
-                    + "continue afterwards with git p4 submit --continue")
-            elif response == "w":
-                system(diffcmd + " > patch.txt")
-                print "Patch saved to patch.txt in %s !" % self.clientPath
-                die("Please resolve and submit the conflict manually and "
-                    "continue afterwards with git p4 submit --continue")
 
         system(applyPatchCmd)