[PATCH 1 of 2] simplemerge: includes revision into merge marker of simplemerge

Mads Kiilerich mads at kiilerich.com
Thu Sep 27 06:27:21 CDT 2012


On 09/27/2012 12:06 PM, pierre-yves.david at logilab.fr wrote:
> # HG changeset patch
> # User Pierre-Yves David <pierre-yves.david at ens-lyon.org>
> # Date 1348738364 -7200
> # Node ID ac1131f2927400cb0e031d6929cfa3ce07cf1a27
> # Parent  d34ba4991188fdfa4f8322b9a32c4c08aaf6ff27
> simplemerge: includes revision into merge marker of simplemerge
>
> Before this changes internal:merge conflict look like::
>
>    <<<<<<< local
>    something else
>    =======
>    something
>    >>>>>>> other
>
> With this changes they look like::
>
>    <<<<<<< local: 32e80765d7fe+
>    something else
>    =======
>    something
>    >>>>>>> other: 75234512624c

That is a behavioural change that might bite someone. That could be 
enough reason to reject this change.

I suggest making some analysis and statement of the possible impact of 
the change. That would make it easier to agree or disagree with the 
change for the right reasons.

> The extra nodeid added refer to the last revision that touched the files in this
> "branch" of the merge.

Really? AFAICS it will show the revisions that are merged, no matter if 
the file is touched in that revision or not.

Is that what you want or is it more like a kind of 'annotate' you are 
looking for?

> Such information should help to remove ambiguous about
> each side of the merge. For example in rebase: `local` is destination and
> `other` is rebased changesets. The only information added is the nodeid. This is
> a simple a short information that allows to retrieves all the other (revid,
> description, date, authors, etc).

Depending on what you want to show:

* Just showing the hash is not very useful for daily use. It would be 
more useful if it also showed the tags and bookmarks of the revisions. 
Also consider that 'annotate' by default uses revision numbers and not 
ids - this feature should perhaps do the same.

* This feature can perhaps be handy for "debugging" hard merges. It 
could perhaps make sense to hide it behind a --debug or -v.

/Mads

>
> diff --git a/mercurial/filemerge.py b/mercurial/filemerge.py
> --- a/mercurial/filemerge.py
> +++ b/mercurial/filemerge.py
> @@ -207,12 +207,13 @@ def _imerge(repo, mynode, orig, fcd, fco
>       r = _premerge(repo, toolconf, files)
>       if r:
>           a, b, c, back = files
>   
>           ui = repo.ui
> -
> -        r = simplemerge.simplemerge(ui, a, b, c, label=['local', 'other'])
> +        label = ['local: %s' % fcd.changectx(),
> +                 'other: %s' % fco.changectx()]
> +        r = simplemerge.simplemerge(ui, a, b, c, label=label)
>           return True, r
>       return False, 0
>   
>   @internaltool('dump', True)
>   def _idump(repo, mynode, orig, fcd, fco, fca, toolconf, files):



More information about the Mercurial-devel mailing list