diff mercurial/wireprotoserver.py @ 39447:5f4a9ada5ab5

wireprotoserver: use our CBOR encoder Moving away from the vendored package. Again, our encoder normalizes keys differently from the vendored package (for now), hence the test changes. Differential Revision: https://phab.mercurial-scm.org/D4467
author Gregory Szorc <gregory.szorc@gmail.com>
date Tue, 28 Aug 2018 18:05:48 -0700
parents e7aa113b14f7
children a9f56e4501c1
line wrap: on
line diff
--- a/mercurial/wireprotoserver.py	Tue Aug 28 18:05:08 2018 -0700
+++ b/mercurial/wireprotoserver.py	Tue Aug 28 18:05:48 2018 -0700
@@ -12,9 +12,6 @@
 import threading
 
 from .i18n import _
-from .thirdparty import (
-    cbor,
-)
 from . import (
     encoding,
     error,
@@ -25,6 +22,7 @@
     wireprotov2server,
 )
 from .utils import (
+    cborutil,
     interfaceutil,
     procutil,
 )
@@ -389,7 +387,7 @@
 
     res.status = b'200 OK'
     res.headers[b'Content-Type'] = b'application/mercurial-cbor'
-    res.setbodybytes(cbor.dumps(m, canonical=True))
+    res.setbodybytes(b''.join(cborutil.streamencode(m)))
 
     return True