[PATCH 6 of 6] filemerge: show actual capabilities of internal merge tools

FUJIWARA Katsunori foozy at lares.dti.ne.jp
Thu Aug 16 10:22:41 EDT 2018


At Thu, 16 Aug 2018 19:13:40 +0900,
Yuya Nishihara wrote:
> 
> On Thu, 16 Aug 2018 03:35:38 +0900, FUJIWARA Katsunori wrote:
> > # HG changeset patch
> > # User FUJIWARA Katsunori <foozy at lares.dti.ne.jp>
> > # Date 1534252828 -32400
> > #      Tue Aug 14 22:20:28 2018 +0900
> > # Node ID f65c2eed9d606cbe7c5c76a8787f2db710abc445
> > # Parent  813cc2cf9c0cae1928584518afb4558c443b77b7
> > # Available At https://bitbucket.org/foozy/mercurial-wip
> > #              hg pull https://bitbucket.org/foozy/mercurial-wip -r f65c2eed9d60
> > # EXP-Topic filemerge-refactor
> > filemerge: show actual capabilities of internal merge tools
> > 
> > This information is useful to know which internal merge tools can be
> > applied safely on binary files and/or symlinks.
> > 
> > diff --git a/mercurial/filemerge.py b/mercurial/filemerge.py
> > --- a/mercurial/filemerge.py
> > +++ b/mercurial/filemerge.py
> > @@ -989,6 +989,12 @@ def loadinternalmerge(ui, extname, regis
> >          internals['internal:' + name] = func
> >          internalsdoc[fullname] = func
> >  
> > +        capabilities = sorted([k for k, v in func.capabilities.items() if v])
> > +        if capabilities:
> > +            capdesc = _("(actual capabilities: %s)") % ', '.join(capabilities)
> > +            func.__doc__ = (func.__doc__ +
> > +                            pycompat.sysstr("\n\n    %s" % capdesc))
> 
> I suspect this would crash if "(actual capabilities: %s)" were translated
> because func.__doc__ is fed to gettext().
>
> Since you are the expert, I leave it to you.
> 

Ouch, I overlooked that! I'll revise that.

-- 
----------------------------------------------------------------------
[FUJIWARA Katsunori]                             foozy at lares.dti.ne.jp


More information about the Mercurial-devel mailing list