[PATCH] filemerge: support specfiying a python function to custom merge-tools

Yuya Nishihara yuya at tcha.org
Fri May 18 07:26:14 EDT 2018


On Thu, 17 May 2018 12:34:26 -0600, Tom Hindle wrote:
> On 05/17/2018 07:14 AM, Yuya Nishihara wrote:
> > On Wed, 16 May 2018 14:22:13 -0600, tom_hindle at sil.org wrote:
> >> # HG changeset patch
> >> # User hindlemail
> > Can you suggest a proper "user" name?
> > test-check-commit.t complains that "username is not an email address."
> 
> oops sorry. My Username should have been set to:
> 
> hindlemail <tom_hindle at sil.org>

Pushed with that, thanks.

> >> +            # avoid cycle cmdutil->merge->filemerge->hook->extensions->cmdutil
> >> +            from . import hook
> >> +            ret, raised = hook.pythonhook(ui, repo, "merge", toolpath,
> >> +                                          mergefn, {'args' : argslist}, True)
> >> +            if raised:
> >> +                r = 1
> > When throw=True, hook.pythonhook() would raise exception instead of returning
> > "raised" value. If throw were False, int(ret) should be copied to r. Which one
> > did you expect?
> I changed this from False -> True, as (iirc) it gave better stack traces
> when python function had errors.

I'm not pretty sure, but raising uncaught exception might leave a
transaction interrupted. You can get a traceback with --traceback option
even if throw=False.

> Shall I deal with this in a follow-up patch?

Yeah, and please add a test.


More information about the Mercurial-devel mailing list