Upgrading a library is very similar to the regular process of updating Unison code. It involves one additional simple command. The following workflow uses Unison's standard library, base
, as an example.
Upgrade workflow:
lib.install
the latest version of the dependency into your codebase so that it is a sibling of your current library version.myProject/main> lib.install @unison/base
- Run the
upgrade
command, indicating which library you'd like to upgrade myProject/main> upgrade unison_base_1_0_0 unison_base_2_0_0
- Run the
- The UCM will create a new branch for the upgrade to take place in, so if something goes wrong and you want to back out of your changes, you can easily switch back to the branch you were on before the upgrade.
- If there are conflicts to resolve, the UCM will open up the affected terms in your editor. Resolve the conflicts and enter
update
again once the file typechecks. - Run
upgrade.commit
to merge the temporary branch created by theupgrade
command back into its parent branch. It will delete the temporary branch.