[PATCH 2 of 3 v2] resolve: print a warning when marking a file with conflict markers

Mads Kiilerich mads at kiilerich.com
Sun Aug 31 08:35:17 CDT 2014


On 08/31/2014 09:56 AM, Gregory Szorc wrote:
> # HG changeset patch
> # User Gregory Szorc <gregory.szorc at gmail.com>
> # Date 1409419638 -7200
> #      Sat Aug 30 19:27:18 2014 +0200
> # Node ID 35c1d268bbd092ffb15b85605b4f5d36c3d08986
> # Parent  55c81bbb9b76fe941faea87e77b0a5c95d4425f2
> resolve: print a warning when marking a file with conflict markers
>
> If you are using internal:merge or any mergetool that inserts
> conflict markers and use `hg resolve -m`, there's a chance you may
> accidentally mark a file with conflict markers as resolved. This
> is almost always unintended.
>
> This patch adds a warning so fewer people will shoot themselves with
> this footgun.

I think one root cause of that problem is that -m defaults to marking 
all files as resolved. Adressing that root cause would be better.

I think -m should require either a filename or --all. That would be the 
good kind of non-backward compatible change.

Anyway, a better implementation of this would perhaps be to avoid the 
layering violation and let resolve -m call filemerge in some way and let 
it run the check.conflicts check if it is configured for the current tool.

/Mads


More information about the Mercurial-devel mailing list