[PATCH 2 of 2 fix] rebase: properly handle chain of marker with missing node
Pierre-Yves David
pierre-yves.david at ens-lyon.org
Wed Oct 14 19:24:16 CDT 2015
On 10/15/2015 01:20 AM, Sean Farley wrote:
>
> Pierre-Yves David <pierre-yves.david at ens-lyon.org> writes:
>
>> # HG changeset patch
>> # User Pierre-Yves David <pierre-yves.david at fb.com>
>> # Date 1444865540 -3600
>> # Thu Oct 15 00:32:20 2015 +0100
>> # Node ID a53d0a524cf14db2ce63b8376020e22dd4f2e636
>> # Parent d2dd179568f5aa46ffc597a393f2df663a4893af
>> # EXP-Topic reb.skip
>> # Available At http://hg.netv6.net/marmoute-wip/mercurial/
>> # hg pull http://hg.netv6.net/marmoute-wip/mercurial/ -r a53d0a524cf1
>> rebase: properly handle chain of marker with missing node
>>
>> As obsolescence markers can contains unknown nodes and 'allsuccessors' returns
>> them, we have to protect again that when looking for successors of the rebase
>> set in the destination.
>>
>> Test have been expanded to catch that.
>>
>> diff --git a/hgext/rebase.py b/hgext/rebase.py
>> --- a/hgext/rebase.py
>> +++ b/hgext/rebase.py
>> @@ -1162,11 +1162,14 @@ def _computeobsoletenotrebased(repo, reb
>> for r in rebasesetrevs:
>> n = repo[r]
>> if n.obsolete():
>> node = cl.node(r)
>> for s in obsolete.allsuccessors(repo.obsstore, [node]):
>> - allsuccessors[cl.rev(s)] = cl.rev(node)
>> + try:
>> + allsuccessors[cl.rev(s)] = cl.rev(node)
>> + except LookupError:
>> + pass
>>
>> if allsuccessors:
>> # Look for successors of obsolete nodes to be rebased among
>> # the ancestors of dest
>> ancs = cl.ancestors([repo[dest].rev()],
>> diff --git a/tests/test-rebase-obsolete.t b/tests/test-rebase-obsolete.t
>> --- a/tests/test-rebase-obsolete.t
>> +++ b/tests/test-rebase-obsolete.t
>> @@ -588,5 +588,53 @@ Test hidden changesets in the rebase set
>>
>> $ hg rebase -s 14 -d 18 --config experimental.rebaseskipobsolete=True
>> note: not rebasing 14:9ad579b4a5de "I", already in destination as 17:fc37a630c901 "K"
>> rebasing 15:5ae8a643467b "J"
>>
>> + $ cd ..
>> +
>> +Skip obsolete changeset even with multiple hope
>
> multiple hop(s)?
groomphs, yes. multiple hops.
--
Pierre-Yves David
More information about the Mercurial-devel
mailing list