Skip to main content

revert_train

Function revert_train 

Source
pub fn revert_train(
    repo: &Path,
    url: &str,
    base: &str,
    tip: &str,
    branch: &str,
) -> Result<String, String>
Expand description

Reverts a landed train (D23 auto-revert arm): reverts each of the train’s merge commits (base..tip, first-parent, newest first) on top of tip, then pushes the result to branch WITHOUT force — if the branch moved past tip since landing, the push is rejected and a human decides. Returns the new branch tip. The reverted tree is byte-identical to base’s tree; history keeps the full record.

§Errors

Git failures, including a revert that itself conflicts (possible when later commits touched the same lines) and the non-fast-forward rejection — both leave the remote branch untouched.