Patchwork [V2] merge: print status message before launching external merge tool

login
register
mail settings
Submitter via Mercurial-devel
Date Feb. 10, 2017, 12:24 a.m.
Message ID <a5615bea1858aca891fc.1486686267@martinvonz.mtv.corp.google.com>
Download mbox | patch
Permalink /patch/18374/
State Accepted
Headers show

Comments

via Mercurial-devel - Feb. 10, 2017, 12:24 a.m.
# HG changeset patch
# User Martin von Zweigbergk <martinvonz@google.com>
# Date 1486661545 28800
#      Thu Feb 09 09:32:25 2017 -0800
# Node ID a5615bea1858aca891fcd3d7da6a477fc183f478
# Parent  1f51b4658f21bbb797e922d155c1046eddccf91d
merge: print status message before launching external merge tool

It seems somewhat common that people run into a merge conflict and
don't notice the launched merge tool, and instead they think hg just
hung. Let's print a message for each file that we launch a GUI merge
tool for.
Sean Farley - Feb. 10, 2017, 11 p.m.
Martin von Zweigbergk via Mercurial-devel
<mercurial-devel@mercurial-scm.org> writes:

> # HG changeset patch
> # User Martin von Zweigbergk <martinvonz@google.com>
> # Date 1486661545 28800
> #      Thu Feb 09 09:32:25 2017 -0800
> # Node ID a5615bea1858aca891fcd3d7da6a477fc183f478
> # Parent  1f51b4658f21bbb797e922d155c1046eddccf91d
> merge: print status message before launching external merge tool
>
> It seems somewhat common that people run into a merge conflict and
> don't notice the launched merge tool, and instead they think hg just
> hung. Let's print a message for each file that we launch a GUI merge
> tool for.

Sure, looks good to me.
Yuya Nishihara - Feb. 12, 2017, 10 a.m.
On Thu, 09 Feb 2017 16:24:27 -0800, Martin von Zweigbergk via Mercurial-devel wrote:
> # HG changeset patch
> # User Martin von Zweigbergk <martinvonz@google.com>
> # Date 1486661545 28800
> #      Thu Feb 09 09:32:25 2017 -0800
> # Node ID a5615bea1858aca891fcd3d7da6a477fc183f478
> # Parent  1f51b4658f21bbb797e922d155c1046eddccf91d
> merge: print status message before launching external merge tool

LGTM. Queued per Sean's review, thanks.

Patch

diff -r 1f51b4658f21 -r a5615bea1858 mercurial/filemerge.py
--- a/mercurial/filemerge.py	Thu Feb 02 14:19:48 2017 +0100
+++ b/mercurial/filemerge.py	Thu Feb 09 09:32:25 2017 -0800
@@ -489,6 +489,9 @@ 
     args = util.interpolate(r'\$', replace, args,
                             lambda s: util.shellquote(util.localpath(s)))
     cmd = toolpath + ' ' + args
+    if _toolbool(ui, tool, "gui"):
+        repo.ui.status(_('running merge tool %s for file %s\n') %
+                       (tool, fcd.path()))
     repo.ui.debug('launching merge tool: %s\n' % cmd)
     r = ui.system(cmd, cwd=repo.root, environ=env)
     repo.ui.debug('merge tool returned: %s\n' % r)