On Mon, 29 Aug 2016 12:52:41 -0500, Mathias De Maré wrote: > # HG changeset patch > # User Mathias De Maré <mathias.dem...@gmail.com> > # Date 1472483920 -7200 > # Mon Aug 29 17:18:40 2016 +0200 > # Node ID fb88d0c87c2746bd84983f1005ed83276c6e9c68 > # Parent 318e2b600b80e4ed3c6f37df46ec7544f60d4c0b > formatter: add support for functions in json > > Some extensions (like largefiles) assign functions to configuration entries. > This was only possible without formatting so far. > > diff --git a/mercurial/formatter.py b/mercurial/formatter.py > --- a/mercurial/formatter.py > +++ b/mercurial/formatter.py > @@ -193,6 +193,8 @@ > elif isinstance(v, (int, float)): > return str(v) > else: > + if callable(v): > + v = "<function %s>" % v.func_name
It should be stringified by the caller. A callable isn't always serializable, and it would be actually called in templater. _______________________________________________ Mercurial-devel mailing list Mercurial-devel@mercurial-scm.org https://www.mercurial-scm.org/mailman/listinfo/mercurial-devel