[PATCH 7 of 7] templatefilters: document json filter that requires UTF-8 bytes

timeless timeless at gmail.com
Fri Mar 11 14:05:26 EST 2016


Yuya Nishihara <yuya at tcha.org> wrote:
> On Fri, 11 Mar 2016 09:39:22 -0500, timeless wrote:
>> So, a reason not to document this filter is if we haven't decided to

(I should have capitalized the "IF" here)

>> formally freeze at our encoding.
>
> You mean "|json" filter might be changed to convert character encoding?

I roughly meant that I don't know the details of what |json does /
what we want it to do / how much testing we have to verify it does
what we want it to do.

> The current version does no encoding conversion.

afaik, it would be possible to add an optional argument to json()
which wouldn't break the behavior of |json, right?
If so, then I don't think that an optional encoding thing blocks
moving forward w/ |json.

> If input is UTF-8, output
> is UTF-8. If input is non-UTF-8 bytes, output is those bytes encapsulated in
> UTF-8 structure to comply JSON spec.

If we're certain about the byte encapsulation (is there testing to verify this?)
and that the json spec is stable, and we don't intend to change it,
then I think we can freeze it and thus a patch to document it is fine.

>> I'm not sure if we have, and I don't know if we have enough tests for its
>> input/output. If we do, then, it's OK to freeze this (if we're confident in
>> the encoding).
>
> Well, I don't think there would be a better way, but I'll happily wait the
> freeze of the whole JSON formatting issues.

The other side (naming conventions) isn't related (imo) and shouldn't
block your change.

There reason I'm handwavy is that I don't want to spend the time
reviewing the JSON spec, the converter code, and the testbase to do
the verification (I have enough things to worry about right now, and
I'm not an official reviewer), so I'm only trying to describe things
in generalities. I believe I've outlined the requirements that someone
else could use to determine whether it's ready.

> Thanks for the clarification.

I hope this clarifies it.


More information about the Mercurial-devel mailing list