Skip to content

Commit 449bb9c

Browse files
Pete Wyckoffgitster
authored andcommitted
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 <[email protected]> Acked-by: Luke Diamand <[email protected]> Signed-off-by: Junio C Hamano <[email protected]>
1 parent 67b0fe2 commit 449bb9c

File tree

1 file changed

+2
-18
lines changed

1 file changed

+2
-18
lines changed

git-p4.py

Lines changed: 2 additions & 18 deletions
Original file line numberDiff line numberDiff line change
@@ -1200,31 +1200,15 @@ def applyCommit(self, id):
12001200
if not patch_succeeded:
12011201
print "What do you want to do?"
12021202
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 ")
12061205
if response == "s":
12071206
print "Skipping! Good luck with the next patches..."
12081207
for f in editedFiles:
12091208
p4_revert(f)
12101209
for f in filesToAdd:
12111210
os.remove(f)
12121211
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")
12281212

12291213
system(applyPatchCmd)
12301214

0 commit comments

Comments
 (0)