diff --git a/mercurial/wireprotov2server.py b/mercurial/wireprotov2server.py --- a/mercurial/wireprotov2server.py +++ b/mercurial/wireprotov2server.py @@ -23,6 +23,7 @@ narrowspec, pycompat, streamclone, + templatefilters, util, wireprotoframing, wireprototypes, @@ -148,8 +149,6 @@ tracker. We then dump the log of all that activity back out to the client. """ - import json - # Reflection APIs have a history of being abused, accidentally disclosing # sensitive data, etc. So we have a config knob. if not ui.configbool('experimental', 'web.api.debugreflect'): @@ -175,12 +174,11 @@ frame.payload)) action, meta = reactor.onframerecv(frame) - states.append(json.dumps((action, meta), sort_keys=True, - separators=(', ', ': '))) + states.append(templatefilters.json((action, meta))) action, meta = reactor.oninputeof() meta['action'] = action - states.append(json.dumps(meta, sort_keys=True, separators=(', ',': '))) + states.append(templatefilters.json(meta)) res.status = b'200 OK' res.headers[b'Content-Type'] = b'text/plain'