[PATCH V3] shelve: restore parents after unshelve (issue5123)

Piotr Listkiewicz piotr.listkiewicz at gmail.com
Wed May 25 09:25:51 EDT 2016


I have done further research and I suspect that modified files after merge
are shown as added because of how shelve.mergefiles works. Commit structure
looks like this:

... -> pctx -> tmpwctx -> shelvectx
                  /
                 /
        second
        merge parent

pctx = parent before merging working context(first merge parent)
tmpwctx = commited working directory after merge, it has two parents
shelvectx = shelved context

shelve.mergefiles first updates to pctx then it reverts shelvectx to pctx
with:

cmdutil.revert(ui, repo, shelvectx, repo.dirstate.parents(),
                       *pathtofiles(repo, files),
                       **{'no_backup': True})

Reverting tmpwctx files that were merged from second parent to pctx makes
them added because they are not in pctx.

I think changing this revert operation is crucial to restore parents after
unshelve. Anybody has any idea how to resolve this?

2016-05-04 0:20 GMT+02:00 Piotr Listkiewicz <piotr.listkiewicz at gmail.com>:

> As code freeze is over it's probably a good time to look at this issue
> once again. Does anybody have any suggestions about described in patch problem
> with merged files which before shelve are marked
> as modified, but after unshelve are marked as added ?
>
> 2016-04-21 7:13 GMT+02:00 Piotr Listkiewicz <piotr.listkiewicz at gmail.com>:
>
>> You might want consider adding a flag for this kind of patch (like WIP)
>>> to make sure people know what they are about.
>>
>>
>> Right, thanks for tip
>>
>>
>>> This seems to be a complicated issue and as this is not fixing a
>>> regression (just a bug that have always been here, right?). So I personally
>>> think we should defer further digging until the freeze is lifted. Piotr
>>> what would you think about that?
>>
>>
>> Yeah, thats the bug thats probably has always been in shelve
>> implementation. I agree about deferring further digging, after freeze i
>> will poke devs about this issue
>>
>> 2016-04-20 23:07 GMT+02:00 Pierre-Yves David <
>> pierre-yves.david at ens-lyon.org>:
>>
>>>
>>>
>>> On 04/11/2016 02:30 PM, liscju wrote:
>>>
>>>> # HG changeset patch
>>>> # User liscju <piotr.listkiewicz at gmail.com>
>>>> # Date 1459461357 -7200
>>>> #      Thu Mar 31 23:55:57 2016 +0200
>>>> # Node ID aba676a11c963282ca8d14d0a25636ecb67e9b54
>>>> # Parent  c5565fc8848dd084d104ca40c33d1acdfcff8bc6
>>>> shelve: restore parents after unshelve (issue5123)
>>>>
>>>> This patch is a work in progress, it has bug and its not
>>>> ready to be merged into repository.
>>>>
>>>
>>> You might want consider adding a flag for this kind of patch (like WIP)
>>> to make sure people know what they are about.
>>>
>>> This seems to be a complicated issue and as this is not fixing a
>>> regression (just a bug that have always been here, right?). So I personally
>>> think we should defer further digging until the freeze is lifted. Piotr
>>> what would you think about that?
>>>
>>> --
>>> Pierre-Yves David
>>>
>>
>>
>
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://www.mercurial-scm.org/pipermail/mercurial-devel/attachments/20160525/4ed8be56/attachment.html>


More information about the Mercurial-devel mailing list