[PATCH] merge: extract _resolvetrivial() function

Mads Kiilerich mads at kiilerich.com
Wed Dec 10 17:43:58 CST 2014


On 12/10/2014 10:18 PM, Martin von Zweigbergk wrote:
> # HG changeset patch
> # User Martin von Zweigbergk <martinvonz at google.com>
> # Date 1417643428 28800
> #      Wed Dec 03 13:50:28 2014 -0800
> # Node ID 9b8dc07b08a2721d1db6f218bee06880a40d168d
> # Parent  07fcb956212223676b35055d39dddac88ca990b6
> merge: extract _resolvetrivial() function
>
> We would eventually like to move the resolution of modify/delete and
> delete/modify conflicts to the resolve phase. However, we don't want
> to move the checks for identical content that were added in
> 902554884335 (merge: before cd/dc prompt, check that changed side
> really changed, 2014-12-01). Let's instead move these out to a new
> _resolvetrivial() function that processes the actions from
> manifestmerge() and replaces any false cd/dc conflicts. The function
> will also provide a natural place for us to later add code for
> resolving false 'm' conflicts.

Hmm ... it doesn't sound wrong ... but so far we don't have any use of 
it and it doesn't add much value by itself. It could perhaps wait until 
we have some use of it and know it is going in the right direction?

Resolving 'm' conflicts in this function seems to imply that we 
duplicate a lot of manifestmerge in this function. Meh.

More important, I would like to somehow move this "changed but same" 
check into manifestmerge, before scheduling any wrong actions. Bid merge 
needs that so it avoids picking unnecessarily hard actions - especially 
merge actions, but also cd/dc. It would be an unfortunate layering 
violation to consider actual file content in manifestmerge and it could 
be costly to retrieve file content an extra time and at the wrong time 
... but that seems to be what it takes. This patch will not help us much 
going in that direction ... if we should end up going in that direction.

/Mads



More information about the Mercurial-devel mailing list