On Wed, 23 Sep 2020 13:48:21 +0530, Pulkit Goyal wrote:
> # HG changeset patch
> # User Pulkit Goyal <7895pul...@gmail.com>
> # Date 1599120846 -19800
> #      Thu Sep 03 13:44:06 2020 +0530
> # Node ID 30332428d8b0233053742be0c27bcb3e6499ed15
> # Parent  62404f1a66ec45ca819d411746138894dcab6e91
> # EXP-Topic merge-newnode
> merge: store commitinfo if mergetool resolved a dc or cd conflict

> diff --git a/mercurial/merge.py b/mercurial/merge.py
> --- a/mercurial/merge.py
> +++ b/mercurial/merge.py
> @@ -1608,6 +1608,27 @@ def applyupdates(
>              if not complete:
>                  numupdates += 1
>                  tocomplete.append((f, args, msg))
> +            else:
> +                action = mresult.getfile(f)[0]
> +                if action in (
> +                    mergestatemod.ACTION_DELETED_CHANGED,
> +                    mergestatemod.ACTION_CHANGED_DELETED,
> +                ):
> +                    # the merge was conflicting and either the mergetool
> +                    # choosed by the user or the user themselves on the 
> prompt
> +                    # made a choice.
> +                    # If the changed file was kept, at commit we end up using
> +                    # the same filelog. This is not completely correct 
> behavior
> +                    # as the new file post merge also represents that a
> +                    # conflicting change-delete merge was resolved in it's
> +                    # favor. Hence we will like to create a new filenode for
> +                    # that. Let's store this in mergestate extras
> +                    repo.ui.debug(
> +                        b"file %s had %s conflicts and mergetool resolved 
> it, storing info in commitinfo\n"
> +                        % (f, action)
> +                    )
> +
> +                    ms.addcommitinfo(f, {b'MERGE_REMOVAL_CANDIDATE': b'yes'})
                                              ^^^^^^^^^^^^^^^^^^^^^^^
Nit: appears that the naming convention of extras is lisp-case.

I feel this is wrong place to record dc/cd resolution. Does it cover the other
cases such as manual resolution by "hg resolve -m"? If new filenode must be
created on dc/cd, I think it's better to record that the file was dc/cd state,
not the dc/cd state was resolved by premerge.
_______________________________________________
Mercurial-devel mailing list
Mercurial-devel@mercurial-scm.org
https://www.mercurial-scm.org/mailman/listinfo/mercurial-devel

Reply via email to