[PATCH 5 of 5 STABLE] hook: omit newly added but omitable hook arguments for legacy Python hooks

Pierre-Yves David pierre-yves.david at ens-lyon.org
Tue May 19 23:06:50 UTC 2015



On 05/19/2015 10:39 AM, FUJIWARA Katsunori wrote:
> # HG changeset patch
> # User FUJIWARA Katsunori <foozy at lares.dti.ne.jp>
> # Date 1432049575 -32400
> #      Wed May 20 00:32:55 2015 +0900
> # Branch stable
> # Node ID 536a7471098c774ad18b4efe5fe8a3ad87eef3c9
> # Parent  29284006c25f44306ce8356f2867f96aa2d2cb60
> hook: omit newly added but omitable hook arguments for legacy Python hooks

This is an insane (but impressively good) amount of boilerplate to 
achieve this.

You should use white list instead of black list because the list of 
unexpected args will keep growing.

But actually I would have went simpler and just caugh "TypeError" an try 
a simpler call for a couple of known hooks we have

But in practice, Matt opinion is "Python hooks are not supported, and if 
they do not use **kwargs, they deserve to die in a fire".

So we should drop this patch and update appropriate wiki page to point 
at this (unsupported API change)

-- 
Pierre-Yves David



More information about the Mercurial-devel mailing list