[PATCH STABLE] mergetools: vimdiff issue a warning explaining how to abort

Kevin Bullock kbullock+mercurial at ringworld.org
Fri Feb 15 15:12:12 CST 2013


On 15 Feb 2013, at 2:08 PM, Matt Mackall wrote:

> On Fri, 2013-02-15 at 13:21 +0100, Benoit Boissinot wrote:
>> Looks good.
> 
>>> -vimdiff.args=$local $other $base
>>> +vimdiff.args=$local $other $base -c 'echohl WarningMsg | echo "merge
>>> conflict detected, type \":cq\" to abort" | echohl'
> 
> Actually, it's not so good. I get an otherwise blank screen that says:
> 
> "smem" 676L, 20653C
> merge conflict detected, type ":cg" to abort
> Press ENTER or type command to continue
> 
> If I were an everyday vimdiff user[1], I would be pissed off by this
> change in very short order. Especially if I were resolving 10 conflicts
> in a row.
> 
> And if I were a NON-vimdiff user, I'd still have just about no idea what
> just happened or how to avoid it in the future.

Just crewed this (after having queued the patch before seeing Matt's response):

changeset:   18877:ec9b9968b7f8
bookmark:    @
tag:         tip
parent:      18874:6a012704c841
user:        Kevin Bullock <kbullock at ringworld.org>
date:        Fri Feb 15 15:06:43 2013 -0600
files:       contrib/mergetools.hgrc
description:
mergetools: refine vimdiff warning message

We explicitly redraw before echoing the message so that it simply
displays at the bottom of the window. Also simplifies the message
printing by using 'echomsg' (which uses 'echohl' internally) and adds
the names of the software involved for improved Googleability.


diff --git a/contrib/mergetools.hgrc b/contrib/mergetools.hgrc
--- a/contrib/mergetools.hgrc
+++ b/contrib/mergetools.hgrc
@@ -15,7 +15,7 @@ gvimdiff.regkeyalt=Software\Wow6432Node\
 gvimdiff.regname=path
 gvimdiff.priority=-9
 
-vimdiff.args=$local $other $base -c 'echohl WarningMsg | echo "merge conflict detected, type \":cq\" to abort" | echohl'
+vimdiff.args=$local $other $base -c 'redraw | echomsg "hg merge conflict, type \":cq\" to abort vimdiff"'
 vimdiff.check=changed
 vimdiff.priority=-10
 

pacem in terris / мир / शान्ति / ‎‫سَلاَم‬ / 平和
Kevin R. Bullock

> Whatever we do in this area, it MUST have negligible impact on people
> who rely on vimdiff today.
> 
> What's needed here is a way to display something in the last line of the
> display (command area?), like how Emacs prints
> 
> For information about the GNU Project and its goals, type M-x describe-project.
> 
> before the first keystroke. That message should include the following
> information:
> 
> - how to exit
> - 'vimdiff' so people can Google
> - 'merge conflict' so people can Google
> 
> Hopefully that Googling can take them to a page in our wiki that
> explains how merge tools are configured and selected.
> 
> Also, I actually went down this path yesterday and discovered your
> version is equivalent to:
> 
> -c ':echo "merge conflict..."'
> 
> I gave up after deciding this called for a vim expert.
> 
> [1] And thank god I'm not, because I seriously hate vi.
> 
> -- 
> Mathematics is the supreme nostalgia of our time.
> 
> 
> _______________________________________________
> Mercurial-devel mailing list
> Mercurial-devel at selenic.com
> http://selenic.com/mailman/listinfo/mercurial-devel





More information about the Mercurial-devel mailing list