[PATCH 0 of 5] Interactive editor merge with markers

Matt Mackall mpm at selenic.com
Thu May 13 15:43:08 CDT 2010


On Thu, 2010-05-13 at 00:30 +0200, Mads Kiilerich wrote:
> David Champion wrote, On 05/11/2010 01:07 AM:
> > * On 10 May 2010, Matt Mackall wrote:
> >    
> >> Ok, I've merged all of this except the actually stanza for
> >> mergetools.hgrc which adds the new editor tool. We should try to figure
> >> out if we can come up with something a little cleaner/more portable here
> >> for finding an appropriate editor.
> >>      
> > How about this? executable, args, and premerge are now implied, but can
> > be overridden.  Here's the minimal mergetools.hgrc entry for it.  (Not
> > sure what your version looks like just now.)
> >    
> 
> 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?
> 
> --- a/mercurial/filemerge.py
> +++ b/mercurial/filemerge.py
> @@ -218,6 +218,8 @@
>           repo.wwrite(fd + ".base", fca.data(), fca.flags())
>           return 1 # unresolved
>       else:
> +        if tool == "internal:editor":
> +            toolpath = util.shellquote(ui.geteditor())
>           args = _toolstr(ui, tool, "args", '$local $base $other')
>           if "$output" in args:
>               out, a = a, back # read input from backup, write to original

I like this.

> --- a/contrib/mergetools.hgrc
> +++ b/contrib/mergetools.hgrc
> @@ -84,3 +84,8 @@
>   araxis.checkconflict=True
>   araxis.binary=True
>   araxis.gui=True
> +
> +internal:editor.check = conflicts, prompt
> +internal:editor.priority = -99
> +internal:editor.premerge = keep
> +internal:editor.args = $local

I'd probably want to comment this out. We actually try to isolate people
from merge markers by default and people appreciate that. I'd rather
complain about "no merge tool" than subject people to them on their
first merge.

-- 
Mathematics is the supreme nostalgia of our time.




More information about the Mercurial-devel mailing list