Fork
A store starts with main. The create_branch tool forks a new branch from a retained version of a source branch. After the fork, the two move independently.
Review
The review_branch tool reads the difference between a branch and the branch it came from, in bounded pages. It shows changed records, counts, conflicts, and any link whose other end is missing. The review answers the version it read.
Merge
The merge_branch tool takes that version as reviewed. If the branch has moved since the review, the merge is refused. The command compares the supplied reviewed version with the source head. The caller is responsible for actually reading the review. It also refuses merge_target_moved if the target has changed since the fork. The merged branch is left as it is.
{
"request_id": "merge-ward-4b-cleanup",
"branch": "main",
"expected": { "generation": "3", "sequence": "41" },
"from": "ward-4b-cleanup",
"reviewed": { "generation": "1", "sequence": "9" }
}
Discard and rename
A branch is discarded with the branch.discard change kind, which names the branch itself.
Renaming happens offline, with the service stopped. The branch-rename command reports what would happen with --check and does it with --apply. See Command line.