“p4 revert -a” will revert branch operations such as an undo of a delete because it does not detect a content change.
Attempting to use SubmitTool to submit an undo of a delete, the code calls “p4 revert -a”.
SubmitTool cannot be modified to detect a branch operation because Engine\Plugins\Developer\PerforceSourceControl\Source\PerforceSourceControl\Private\PerforceSourceControlOperations.cpp doesn’t mark the files as branch operations.
This was a long-standing issue for the Engine’s source control system. Internally, we decided to drive the submit tool through its own implementation of P4 commands, so as not to affect the Editor. We decoupled all the p4 commands to interact directly with the p4api on this change https://github.com/EpicGames/UnrealEngine/commit/15d32d3967f744db6fffa956e70717e338e204d5 (there might’ve been a couple of follow-up submissions, but that was the main one)
Among all the changes we made, which optimized the program, was removing the p4 revert that you’re referring to in favour of
p4 submit -f revertunchangedThe development of Submit Tool happens only in Main, and it’s not necessarily stabilized in other branches, so if you’d like to get the latest updates, you’ll want to always look in Main