[PATCH] merge: improve conflict markers by pointing to introrev

Simon Farnsworth simonfar at fb.com
Tue Mar 8 13:40:53 EST 2016

On 08/03/2016, 14:20, "Yuya Nishihara" <youjah at gmail.com on behalf of yuya at tcha.org> wrote:

>On Tue, 8 Mar 2016 13:24:02 +0000, Simon Farnsworth wrote:
>> I'm reworking this so that conflict markers can access both the merge heads and the introrev to get you tags and bookmarks from both the merge side and the introrev. The issue this patch tries to address is that if you've got a large, fast moving, monolithic repository, the conflict markers are confusing (and we've had complaints that Mercurial doesn't get them right) - you're working on the backend C++ codebase, but (for some reason that's beyond you), you've got a conflict that references Android work only.
>> That's the goal of the extra revset predicates (separate patch series); by providing you with an easy route to find the three interesting points of a three way merge on a file (introrev of the local and other parts of the merge, and the base node), you have the tools to write a revset alias that gets you all the commits that touched unresolved files (for example):
>> With
>> [revsetalias]
>> conflicts($1) = conflict("base",$1)::(conflict("other",$1) or conflict("local",$1)) and file($1)
>FWIW, if a file name and conflict side are provided, conflict marker can be
>build by a template expression.
>  {revset("conflict(%s, %s)", conflictside, "path:{file}") % "{node|short}"}

Not at the point Mercurial wants to build the conflict marker, unfortunately; conflict markers are created when we merge the files together and hit a conflict, but merge conflicts are not recorded until we've completed merging files.


More information about the Mercurial-devel mailing list