Patchwork filemerge: don't pass function name as loadpath's module_name param

login
register
mail settings
Submitter Tom Hindle
Date May 24, 2018, 9:57 p.m.
Message ID <c5db59b1bae015d926ef.1527199044@hindlet>
Download mbox | patch
Permalink /patch/31847/
State Accepted
Headers show

Comments

Tom Hindle - May 24, 2018, 9:57 p.m.
# HG changeset patch
# User hindlemail <tom_hindle@sil.org>
# Date 1527199007 21600
#      Thu May 24 15:56:47 2018 -0600
# Node ID c5db59b1bae015d926ef172d9201141a40719781
# Parent  bd7a3fa71a72666691b8b77e6bf03be1d2273391
filemerge: don't pass function name as loadpath's module_name param
Yuya Nishihara - May 25, 2018, 12:50 p.m.
On Thu, 24 May 2018 15:57:24 -0600, tom_hindle@sil.org wrote:
> # HG changeset patch
> # User hindlemail <tom_hindle@sil.org>
> # Date 1527199007 21600
> #      Thu May 24 15:56:47 2018 -0600
> # Node ID c5db59b1bae015d926ef172d9201141a40719781
> # Parent  bd7a3fa71a72666691b8b77e6bf03be1d2273391
> filemerge: don't pass function name as loadpath's module_name param

Queued, thanks.

Patch

diff -r bd7a3fa71a72 -r c5db59b1bae0 mercurial/filemerge.py
--- a/mercurial/filemerge.py	Thu May 24 23:26:28 2018 +0900
+++ b/mercurial/filemerge.py	Thu May 24 15:56:47 2018 -0600
@@ -569,17 +569,17 @@  def _xmerge(repo, mynode, orig, fcd, fco
                           blockedtag='mergetool')
         else:
             repo.ui.debug('launching python merge script: %s:%s\n' %
                           (toolpath, scriptfn))
             r = 0
             try:
                 # avoid cycle cmdutil->merge->filemerge->extensions->cmdutil
                 from . import extensions
-                mod = extensions.loadpath(toolpath, 'hgmerge.%s' % scriptfn)
+                mod = extensions.loadpath(toolpath, 'hgmerge.%s' % tool)
             except Exception:
                 raise error.Abort(_("loading python merge script failed: %s") %
                                   toolpath)
             mergefn = getattr(mod, scriptfn, None)
             if mergefn is None:
                 raise error.Abort(_("%s does not have function: %s") %
                                   (toolpath, scriptfn))
             argslist = procutil.shellsplit(args)