unison
unison copied to clipboard
overhaul `update` flow
Overview
This PR amends the update flow as follows:
- When an
updatepropagation fails (say on branchmain), we create a new "update branch" calledupdate-main. The branch's underlying contents are identical tomain, except without any of the definitions being updated, nor any of their transitive dependents. - Like merge branches, update branches' unique type guids are reused (if possible) from the parent branch.
- As on trunk, the scratch file is prepended with a new fold that contains all adds/updates in the original scratch file that the user tried to update with, plus all transitive dependents of the updates.
- When on an update branch, if an
updatesucceeds, it behaves like amerge.commit: the branch is merged back into its parent and deleted. (A failedupdatewhile on an update branch does not create a second update branch).
This new flow effectively allows users to delete definitions more easily during an update, because transitive dependents of a failed update are not left in the underlying namespace on an update branch; they exist only in the scratch file.
The slurp output on an update branch has been updated and modernized to communicate these "effective deletes":
This new update flow is only available if ucm is run with a UNISON_USE_UPDATE_V2= environment variable, so we can dogfood a bit before releasing it for real.
Loose ends
- "Old slurp" output should be reworked to look like "new slurp" (i.e. old slurp and new slurp should be unified in code)
- "New slurp" should mention aliases, as old slurp does
- Remove environment var