git p4: revert deleted files after submit cancel

The user can decide not to continue with a submission,
by not saving the p4 submit template, then answering "no" to
the "Submit anyway?" prompt.  In this case, be sure to
return the p4 client to its initial state.

Deleted files were not reverted; fix this and test all cases.

Signed-off-by: Pete Wyckoff <pw@padd.com>
Acked-by: Luke Diamand <luke@diamand.org>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
This commit is contained in:
Pete Wyckoff
2012-09-09 16:16:09 -04:00
committed by Junio C Hamano
parent 55ac2ed6f5
commit df9c5453b2
2 changed files with 121 additions and 0 deletions

View File

@ -1304,6 +1304,8 @@ class P4Submit(Command, P4UserMap):
for f in filesToAdd:
p4_revert(f)
os.remove(f)
for f in filesToDelete:
p4_revert(f)
os.remove(fileName)
return ret