[PATCH 0 of 5] Interactive editor merge with markers

Mads Kiilerich mads at kiilerich.com
Wed May 12 18:58:50 CDT 2010


David Champion wrote, On 05/13/2010 12:49 AM:
> * On 12 May 2010, Mads Kiilerich wrote:
>    
>> I think that the changes needed to handle the special cases implied
>> by internal:editor are so inelegant that I don't think that is the
>> right way to do it.
>>
>> Why not just let internal:editor use the system editor, and leave
>> the configuration of args and premerge to the default mergetool
>> configuration and the user?
>>      
> You're referring to the special handling of args when tool is
> "internal:editor"?  This is a fair criticism -- I don't like that code
> either -- but since nobody would ever want to open $local, $base, *and*
> $other in ui.editor it doesn't make sense to me for that to be the
> default behavior for a not-fully-configured tool.

I could be nobody. ;-)

"meld" can be used as an editor too, but the default args with several 
files with local base and other would work just fine. In other editors 
with several tabs it could be convenient to have the other files 
available for reference as well.

> And the value of
> internal:editor.args is almost always going to be simply "$local".
>
> mergetools.hgrc is not active unless the user includes it, so there's no
> sane default mechanism in place except this code.  If the user doesn't
> configure internal:editor, it can either just work or it can fail, but
> it shouldn't do something crazy that's difficult for the inexperienced
> user to debug and fix.
>    

Regarding the default value for args: It is normal for a configuration 
to have many merge tools configured, so a good 3-way default for args is 
very convenient. And there has to be a default value there, so using an 
ordinary 3-way value is obviously the best choice.

But internal:editor is configured only once, has no backward 
compatibility restrictions, has to be configured, and it is kind of 
special anyway, so I don't think there is much benefit from hardcoding a 
default policy.

However, if it should be, then I think it would make more sense to let 
premerge=keep (which combines local, base and other into local) change 
the default args to just $local.


(By the way: I don't think it is obvious what "premerge=keep" means. 
"keep" could refer to something like keeping a backup, and I don't 
associate "keep" with "mark conflicts inline with markers for manual 
resolve in an editor".  I think it would be more obvious if it was 
called something like "markers" or "inline".)

/Mads


More information about the Mercurial-devel mailing list