[PATCH 6 of 6 RFC] destutil: choose non-closed branch head as default update destination (BC)

Pierre-Yves David pierre-yves.david at ens-lyon.org
Fri Feb 26 16:58:41 EST 2016



On 02/25/2016 12:19 AM, Pierre-Yves David wrote:
>
>
> On 02/24/2016 03:17 PM, FUJIWARA Katsunori wrote:
>> # HG changeset patch
>> # User FUJIWARA Katsunori <foozy at lares.dti.ne.jp>
>> # Date 1456322433 -32400
>> #      Wed Feb 24 23:00:33 2016 +0900
>> # Node ID ae5d291a6dcb96683eae3c4e33575297fa113fbb
>> # Parent  1f9b3d38e380b018cbe10ed1acee882c014e3763
>> destutil: choose non-closed branch head as default update destination
>> (BC)
>>
>> Before this patch, destupdate() returns the tipmost (descendant)
>> branch head regardless of closed or not. But updating to closed branch
>> head isn't reasonable for ordinary workflow, because:
>>
>>    - "hg heads" doesn't show closed heads (= updated parent itself) by
>>      default
>>
>>    - subsequent committing on it re-opens closed branch
>>
>>      even if inactivation of closed head is needed, update destination
>>      isn't it, because it should be merged into to another branch in
>>      such case.
>
> Excluding closed head from update makes a lot of sense to me. But we
> probably need some better messaging around the no-op update. I'm not
> exactly sure no-op update is the right choice if there is nothing but
> closed head above. However giving priority to non-closed head seems an
> obvious way to go here.
>
> I need to think about the "no non-closed heads in .::" case a bit more.
>
> Thanks for looking into that.

I did not though too much about it, but here is some random ideas.

- update pick open heads over closed heads if you have multiple 
descendants head
- update still update to closed heads if there is only that
- the message is update to warn about 'hg update took you to a closed 
head, beware of ghost and other zombi"

-- 
Pierre-Yves David


More information about the Mercurial-devel mailing list