How is the shelve tool and chunk selection supposed to work?

286 views
Skip to first unread message

James McKay

unread,
Feb 25, 2011, 2:53:49 PM2/25/11
to TortoiseHg Developers
I've been trying out the shelve tool and chunk selection in TortoiseHg
1.9.3+171 and I'm a bit puzzled about how it's supposed to work.

I select a file in the left hand side pane and click the right arrow
to move it into the shelf. That's OK, the file moves to the right hand
side, which I presume means its changes are now in the shelf.

However, when I click "Move selected files left," it tells me that x
out of x hunks failed and asks me if I want to edit the patched file
and rejects.

When I go into the resolve dialog the only way that I can see of
getting the changes back into the file correctly is to enter them
manually into the top input box, or copying and pasting. Simply
clicking the green tick box to resolve them just results in those
changes being lost altogether.

Is this by design and am I missing something, or is shelve/chunk
selection still a work in progress?

Steve Borho

unread,
Feb 25, 2011, 3:24:21 PM2/25/11
to thg...@googlegroups.com, James McKay
On Fri, Feb 25, 2011 at 1:53 PM, James McKay <co...@jamesmckay.net> wrote:
> I've been trying out the shelve tool and chunk selection in TortoiseHg
> 1.9.3+171 and I'm a bit puzzled about how it's supposed to work.
>
> I select a file in the left hand side pane and click the right arrow
> to move it into the shelf. That's OK, the file moves to the right hand
> side, which I presume means its changes are now in the shelf.

That's normal.

> However, when I click "Move selected files left," it tells me that x
> out of x hunks failed and asks me if I want to edit the patched file
> and rejects.

That's odd. My guess is that the patch and the file disagree on EOL,
causing the conflicts. Try adding to your Mercurial.ini:

[patch]
eol = auto

> When I go into the resolve dialog the only way that I can see of
> getting the changes back into the file correctly is to enter them
> manually into the top input box, or copying and pasting. Simply
> clicking the green tick box to resolve them just results in those
> changes being lost altogether.
>
> Is this by design and am I missing something, or is shelve/chunk
> selection still a work in progress?

That is the way the rejects dialog works. You have to hand-merge
rejects, the tool just tries to help it along by showing where the
chunk was supposed to apply and making the chunk lines easy copy-paste
material. The resolved/unresolved state is for your book keeping, to
keep track of which chunks you have resolved.

Before this dialog existed, you had to open the two files in a text
editor and do the merge by hand.

--
Steve Borho

James McKay

unread,
Feb 25, 2011, 6:30:02 PM2/25/11
to TortoiseHg Developers
On Feb 25, 8:24 pm, Steve Borho <st...@borho.org> wrote:

> > However, when I click "Move selected files left," it tells me that x
> > out of x hunks failed and asks me if I want to edit the patched file
> > and rejects.
>
> That's odd.  My guess is that the patch and the file disagree on EOL,
> causing the conflicts.  Try adding to your Mercurial.ini:
>
> [patch]
> eol = auto

That did the trick, though I don't see where the inconsistency would
have crept in. It works fine on files with Unix-like line endings (LF)
but it gives conflicts with Windows-like line endings (CR LF). Is the
shelve tool ignoring (or failing to handle correctly) the default
setting eol=strict here?

> > When I go into the resolve dialog the only way that I can see of
> > getting the changes back into the file correctly is to enter them
> > manually into the top input box, or copying and pasting. Simply
> > clicking the green tick box to resolve them just results in those
> > changes being lost altogether.
>
> > Is this by design and am I missing something, or is shelve/chunk
> > selection still a work in progress?
>
> That is the way the rejects dialog works.  You have to hand-merge
> rejects, the tool just tries to help it along by showing where the
> chunk was supposed to apply and making the chunk lines easy copy-paste
> material.  The resolved/unresolved state is for your book keeping, to
> keep track of which chunks you have resolved.
>
> Before this dialog existed, you had to open the two files in a text
> editor and do the merge by hand.

That makes sense now that I've managed to get the shelve tool working
correctly.

Steve Borho

unread,
Feb 25, 2011, 11:49:02 PM2/25/11
to thg...@googlegroups.com, James McKay
On Fri, Feb 25, 2011 at 5:30 PM, James McKay <co...@jamesmckay.net> wrote:
> On Feb 25, 8:24 pm, Steve Borho <st...@borho.org> wrote:
>
>> > However, when I click "Move selected files left," it tells me that x
>> > out of x hunks failed and asks me if I want to edit the patched file
>> > and rejects.
>>
>> That's odd.  My guess is that the patch and the file disagree on EOL,
>> causing the conflicts.  Try adding to your Mercurial.ini:
>>
>> [patch]
>> eol = auto
>
> That did the trick, though I don't see where the inconsistency would
> have crept in. It works fine on files with Unix-like line endings (LF)
> but it gives conflicts with Windows-like line endings (CR LF). Is the
> shelve tool ignoring (or failing to handle correctly) the default
> setting eol=strict here?

I don't think so, but I've made a note to myself to test this to see
where the conflicts are coming from before the 2.0 release.

>> > When I go into the resolve dialog the only way that I can see of
>> > getting the changes back into the file correctly is to enter them
>> > manually into the top input box, or copying and pasting. Simply
>> > clicking the green tick box to resolve them just results in those
>> > changes being lost altogether.
>>
>> > Is this by design and am I missing something, or is shelve/chunk
>> > selection still a work in progress?
>>
>> That is the way the rejects dialog works.  You have to hand-merge
>> rejects, the tool just tries to help it along by showing where the
>> chunk was supposed to apply and making the chunk lines easy copy-paste
>> material.  The resolved/unresolved state is for your book keeping, to
>> keep track of which chunks you have resolved.
>>
>> Before this dialog existed, you had to open the two files in a text
>> editor and do the merge by hand.
>
> That makes sense now that I've managed to get the shelve tool working
> correctly.
>

--
Steve Borho

Reply all
Reply to author
Forward
0 new messages