allow deleting while resolving an upgrade failure #5872
Merged
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Overview
This PR makes
upgradework likeupdatewhen it fails – the branch it puts you on has all dependents of the failures removed from the underlying namespace, so deleting any from the scratch file functions like a delete.It also makes a successful
updateon an "upgrade branch" merge the branch back into the parent, like a successful update on an "update branch". So,upgrade.commitis no longer necessary and was replaced with a stub implementation.Finally, I elected to make
upgradeon both an "update branch" and "upgrade branch" fail immediately with an error message. I think we can revisit this and try to find a sensible implementation, but you basically don't ever want to do this with the current implementation, so I think it's better to disallow it. The workaround is to upgrade one library at a time (if trying to upgrade while resolving a failed upgrade), or upgrade before updating (if trying to upgrade while resolving a failed update).Test coverage
I added a case to the existing transcript to demonstrate that
upgradehas this delete-y behavior, and also manually tested in the terminal.