Merge union order

John W jwdevel at gmail.com
Tue Jan 24 18:17:20 UTC 2023


Just in case you're unaware: you can also create a custom merge tool
to handle this case. Downside: all users need to have the tool
installed. Upside: you can use whatever custom logic you want.

You can use the [merge-patterns] config to have that tool only apply
to your CHANGELOG file.

-John

On 1/24/23, Raphaël Gomès <raphael.gomes at octobus.net> wrote:
> 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?
> _______________________________________________
> Mercurial mailing list
> Mercurial at lists.mercurial-scm.org
> https://lists.mercurial-scm.org/mailman/listinfo/mercurial
>


More information about the Mercurial mailing list