[PATCH 3 of 6] filemerge: add the function to examine a capability of a internal tool

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


At Thu, 16 Aug 2018 18:51:55 +0900,
Yuya Nishihara wrote:
> 
> On Thu, 16 Aug 2018 03:35:35 +0900, FUJIWARA Katsunori wrote:
> > # HG changeset patch
> > # User FUJIWARA Katsunori <foozy at lares.dti.ne.jp>
> > # Date 1534245351 -32400
> > #      Tue Aug 14 20:15:51 2018 +0900
> > # Node ID 1d16378efeb91e435d520b081a7a34b78d7fa7e2
> > # Parent  ca968875ed9869cbfa464af05c2a217219f298ed
> > # Available At https://bitbucket.org/foozy/mercurial-wip
> > #              hg pull https://bitbucket.org/foozy/mercurial-wip -r 1d16378efeb9
> > # EXP-Topic filemerge-refactor
> > filemerge: add the function to examine a capability of a internal tool
> 
> > Users can configure them explicitly as below for example, but this is
> > not ordinary usage and not convenient:
> > 
> >   [merge-tools]
> >   :other.symlink = true
> >   :other.binary = true
> 
> Is this a documented feature? I suspect it would be a bug.

Not documented, but works so, because _toolbool() does not check
whether specified 'tool' is internal one or not.

I'm OK to ignore configurations in "merge-tools" for internal merge
tools, if this is out of backward compatibility scope.

Should I do so ?


> > --- a/mercurial/filemerge.py
> > +++ b/mercurial/filemerge.py
> > @@ -137,6 +137,12 @@ def findexternaltool(ui, tool):
> >      return procutil.findexe(util.expandpath(exe))
> >  
> >  def _picktool(repo, ui, path, binary, symlink, changedelete):
> > +    def hascapability(tool, capability, strict=False):
> > +        if strict and tool in internals:
> > +            if internals[tool].capabilities.get(capability):
> > +                return True
> > +        return _toolbool(ui, tool, capability)
> 
> If we want to support "merge-tools:<foo>.binary = false" for example, we'll
> have to make _toolbool() tri-state.
> 

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


More information about the Mercurial-devel mailing list