To reproduce:
- Shelve an uncommitted change on a branch.
- Update to another branch.
- Unshelve the change you shelved.
What should happen: The shelved changes should be applied to the new branch, and that's all.
What happens: The shelved changes are applied, but any differences between the first and second branch are also applied, effectively doing an unwanted merge.
None of the hgattic documentation discusses what's expected behavior when unshelving to a different branch, but my co-workers and I often need to move uncommitted changes to another branch, and the Shelve command is very unpredictable. We work around it by:
- Creating a patch with the uncommitted changes
- Revert all.
- Update to the other branch.
- Apply the patch.
However, SourceTree's interface for using shelves is much more intuitive and convenient than using patches, and we'd much rather use shelves if they did what we want.