Merge union order

Raphaël Gomès raphael.gomes at octobus.net
Tue Jan 24 10:47:19 UTC 2023


On 1/24/23 11:35, Cédric Krier via Mercurial wrote:
> On 2023-01-14 10:54, Cédric Krier via Mercurial wrote:
>> Hi,
>>
>> In our repository we are filling a CHANGELOG text file when developing
>> new feature. The rule is to append on top of the file new entries.
>> The problem is that obviously we have very often merge conflict with
>> that file. So in order to simplify the merge process, I though about
>> using `internal:union` tool. This works great but instead of having the
>> new entry on top, it is merged at the bottom of the conflict.
>> So is there a way to tell `internal:union` to unify the other way?
> I see in simplemerge of mercurial/simplemerge.py that:
>
> if mode == b'union':
>      lines = _resolve(m3, (1, 2))
>
> Would it be acceptable to add another mode with:
>
>      lines = _resolve(m3, (2, 1))
>
I don't see why not, maybe call it "union-reverse". Could you send a MR?


More information about the Mercurial mailing list