[PATCH 3 of 5] registrar: define revsetpredicate to decorate revset predicate

Yuya Nishihara yuya at tcha.org
Sat Jan 9 05:32:54 CST 2016


On Sat, 09 Jan 2016 19:41:37 +0900, FUJIWARA Katsunori wrote:
> At Fri, 8 Jan 2016 00:01:57 +0900,
> Yuya Nishihara wrote:
> > On Tue, 05 Jan 2016 20:48:36 +0900, FUJIWARA Katsunori wrote:
> > > +def loadpredicate(ui, extname, predicateobj):
> > > +    """Load revset predicates from specified predicateobj
> > > +    """
> > > +    if not isinstance(predicateobj, registrar.revsetpredicate):
> > > +        # extension may not know about recent 'revsetpredicate' naming rule
> > > +        return
> > 
> > This looks like a temporary workaround, but the next patch doesn't remove it.
> 
> No, this is a guard for (existing) 3rd party extension, which
> accidentally defines 'revsetpredicate' symbol in it for another
> purpose.
> 
> If this comment causes confusion, how about "3rd party extension may
> define this for another purpose" or so ?

In that case, it's better to have some warning. Silent return is likely to
shadow bugs.

But I don't think it is necessary. We haven't care when we added 'testedwith',
'buglink' or 'minimumhgversion'.


More information about the Mercurial-devel mailing list