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

Pierre-Yves David pierre-yves.david at ens-lyon.org
Tue Sep 2 14:11:19 CDT 2014



On 08/31/2014 03:35 PM, Mads Kiilerich wrote:
> 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.

Actually there is there multiple way to get that:

My main common cause for this is me missing a second markers after 
resolving the first one. (or me forgetting to drop the leading << or 
closing >> when dropping the rest of the markers.)

(I'm much less often bitten by that as I now use contrib/editmerge that 
happily reopen the file again if it detect any markers.)

I think this proposal is a good improvement.

-- 
Pierre-Yves David


More information about the Mercurial-devel mailing list