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:
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.
If this is in Mercurial this is due to a bug in the shelve extension we use from Mercurial. We've actually got a planned bugfix on this front but no-one had reported it until now. You're right that this is completely the wrong behaviour, it should only unshelve the changes that are in the shelved changeset.
We're planning on moving away from hgattic for a number of reasons, one being for partial shelving and the other to fix this bug.
Thanks for listing the workaround, I'll make sure I take note if anyone asks in the meantime. We'll look at getting this in sooner than we planned as it's extremely difficult to fix if you do apply the shelve.
The related issues on JIRA are https://jira.atlassian.com/browse/SRCTREE-1460 and https://jira.atlassian.com/browse/SRCTREE-1375 currently scheduled for 1.7 but I'll squeeze these into a 1.6.x release instead.
Thanks for the information
Badges are a great way to show off community activity, whether you’re a newbie or a Champion.Learn more
Supported Platforms macOS Windows To make using Sourcetree as simple yet powerful as possible we embed (bundle) dependencies such as Git, Git LFS, and Mercurial. We strive to keep these...
Connect with like-minded Atlassian users at free events near you!Find a group
Connect with like-minded Atlassian users at free events near you!
Unfortunately there are no AUG chapters near you at the moment.Start an AUG
You're one step closer to meeting fellow Atlassian users at your local meet up. Learn more about AUGs