Unshelving across branches performs unwanted merge

incidentist June 20, 2013

To reproduce:

  1. Shelve an uncommitted change on a branch.
  2. Update to another branch.
  3. 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:

  1. Creating a patch with the uncommitted changes
  2. Revert all.
  3. Update to the other branch.
  4. 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.

1 answer

1 accepted

1 vote
Answer accepted
KieranA
Rising Star
Rising Star
Rising Stars are recognized for providing high-quality answers to other users. Rising Stars receive a certificate of achievement and are on the path to becoming Community Leaders.
June 20, 2013

Hi Dan,

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

incidentist June 20, 2013

Thanks, Kieran! This will have a huge benefit for our team of 20 engineers.

Roger Versluis October 17, 2014

Hi guys, is there already a time line for this fix? The Patch workaround doesn't work either because patching is broken.

Suggest an answer

Log in or Sign up to answer
TAGS
AUG Leaders

Atlassian Community Events