Patchwork D5520: simplestorerepo: migrate to in-hg CBOR code

login
register
mail settings
Submitter phabricator
Date Jan. 9, 2019, 11:08 p.m.
Message ID <002b718f04e0abf30b44d691dc18d788@localhost.localdomain>
Download mbox | patch
Permalink /patch/37595/
State Not Applicable
Headers show

Comments

phabricator - Jan. 9, 2019, 11:08 p.m.
This revision was automatically updated to reflect the committed changes.
Closed by commit rHGad51e6117095: simplestorerepo: migrate to in-hg CBOR code (authored by durin42, committed by ).

REPOSITORY
  rHG Mercurial

CHANGES SINCE LAST UPDATE
  https://phab.mercurial-scm.org/D5520?vs=13067&id=13114

REVISION DETAIL
  https://phab.mercurial-scm.org/D5520

AFFECTED FILES
  tests/simplestorerepo.py

CHANGE DETAILS




To: durin42, indygreg, #hg-reviewers
Cc: mercurial-devel

Patch

diff --git a/tests/simplestorerepo.py b/tests/simplestorerepo.py
--- a/tests/simplestorerepo.py
+++ b/tests/simplestorerepo.py
@@ -23,7 +23,6 @@ 
 )
 from mercurial.thirdparty import (
     attr,
-    cbor,
 )
 from mercurial import (
     ancestor,
@@ -39,6 +38,7 @@ 
     verify,
 )
 from mercurial.utils import (
+    cborutil,
     interfaceutil,
     storageutil,
 )
@@ -106,7 +106,7 @@ 
 
         indexdata = self._svfs.tryread(self._indexpath)
         if indexdata:
-            indexdata = cbor.loads(indexdata)
+            indexdata = cborutil.decodeall(indexdata)
 
         self._indexdata = indexdata or []
         self._indexbynode = {}
@@ -513,7 +513,8 @@ 
 
     def _reflectindexupdate(self):
         self._refreshindex()
-        self._svfs.write(self._indexpath, cbor.dumps(self._indexdata))
+        self._svfs.write(self._indexpath,
+                         ''.join(cborutil.streamencode(self._indexdata)))
 
     def addgroup(self, deltas, linkmapper, transaction, addrevisioncb=None,
                  maybemissingparents=False):