problems with shelve

Benjamin Fritz fritzophrenic at gmail.com
Mon Jan 24 09:26:16 CST 2011


First of all, I get digest messages, and could not figure out how to
reply to a specific message; I apologize if this screws up message
threading for anyone.


> ---------- Forwarded message ----------
> From: Steve Borho <steve at borho.org>
> To: Matt Mackall <mpm at selenic.com>
> Date: Tue, 18 Jan 2011 14:06:10 -0600
> Subject: Re: problems with shelve
> On Tue, Jan 18, 2011 at 1:23 PM, Matt Mackall <mpm at selenic.com> wrote:
>> On Mon, 2011-01-17 at 06:24 -0800, amos.eisenstadt at nsn.com wrote:
>>
>>> My name is Amos Eisenstadt
>>> I'm responsible for the Mercurial at my company, ASPEN  group which is part of NSN. We have some problems with mecurial.
>>> I have few questions: (only 1 for now)
>>> 1. when using shelve, and then pull (fetch), if the class that is in shelve is also modifyed by the pull. it's imossible to unshelve all of the shelve files. is there a sulotion to this problem.
>
> I'm afraid the only solution to this is to not use shelve.  You need
> to perform a merge between the original change and the pulled change.
> Mercurial has mechanisms for merging two changesets (preferred) and
> for merging uncommitted changes to a descendant changeset (less
> preferred).  But it has no mechanism for merging a patch with a
> changeset.
>
> So if you do not wish to commit your changes before pulling and
> updating, you are better off allowing Mercurial to merge your changes
> with the pulled changeset rather than shelving, updating, and
> unshelving.
>

What about simply doing an update to the reversion the shelved changes
are based on, *then* unshelving, committing, and merging, or
unshelving and saving off a diff, which can be applied later to the
tip (and possibly shelved again)?

This allows you to use shelve most of the time, and in the few
situations where an update contains changes which conflict with the
shelved changes, you can correct it as above.


More information about the Mercurial mailing list