[PATCH STABLE] keyword: use fctx.filenode() instead of internal var (issue5364)

Yuya Nishihara yuya at tcha.org
Mon Oct 17 09:56:02 EDT 2016


On Mon, 17 Oct 2016 13:59:10 +0200, Christian Ebert wrote:
> * Yuya Nishihara on Friday, September 09, 2016 at 21:50:31 +0900
> > On Thu, 08 Sep 2016 17:12:34 +0100, Christian Ebert wrote:
> >> @@ -739,7 +739,7 @@ def reposetup(ui, repo):
> >>     def kwfilectx_cmp(orig, self, fctx):
> > 
> > Maybe we'll have to handle _customcmp instead?
> > 
> > https://selenic.com/repo/hg/log?rev=bd19561b98d9%3A%3A7b038ec6c5fd
> 
> To be honest, I can't wrap my head around that. But do you simply mean
> something like:
> 
> diff --git a/hgext/keyword.py b/hgext/keyword.py
> --- a/hgext/keyword.py
> +++ b/hgext/keyword.py
> @@ -737,6 +737,8 @@ def reposetup(ui, repo):
>              return ret
> 
>      def kwfilectx_cmp(orig, self, fctx):
> +        if fctx._customcmp:
> +            return fctx.comp(self)

Yeah, something like that. Per the backtrace in issue5364, fctx was an
absentfilectx. In which case, basefilectx.cmp() is delegated to
absentfilectx.cmp(). It makes sense to do the same here.


More information about the Mercurial-devel mailing list