Patchwork [05,of,15] rawdata: update callers in sqlitestore

login
register
mail settings
Submitter Pierre-Yves David
Date Aug. 15, 2019, 10:40 a.m.
Message ID <333d279ffd3109ce7e2e.1565865603@nodosa.octopoid.net>
Download mbox | patch
Permalink /patch/41284/
State Accepted
Headers show

Comments

Pierre-Yves David - Aug. 15, 2019, 10:40 a.m.
# HG changeset patch
# User Pierre-Yves David <pierre-yves.david@octobus.net>
# Date 1565201393 -7200
#      Wed Aug 07 20:09:53 2019 +0200
# Node ID 333d279ffd3109ce7e2e899fe7b513e1334174e7
# Parent  475f24d36ed010725534e60e0ea0a2a0d9d914ff
# EXP-Topic rawdata
# Available At https://bitbucket.org/octobus/mercurial-devel/
#              hg pull https://bitbucket.org/octobus/mercurial-devel/ -r 333d279ffd31
rawdata: update callers in sqlitestore

We update callers incrementally because this help bisecting failures. This was
useful during development, so we expect it might be useful again in the future.

Patch

diff --git a/hgext/sqlitestore.py b/hgext/sqlitestore.py
--- a/hgext/sqlitestore.py
+++ b/hgext/sqlitestore.py
@@ -656,8 +656,7 @@  class sqlitefilestore(object):
             # patch operation.
             if baserev != nullrev and self.iscensored(baserev):
                 hlen = struct.calcsize('>lll')
-                oldlen = len(self.revision(deltabase, raw=True,
-                                           _verifyhash=False))
+                oldlen = len(self.rawdata(deltabase, _verifyhash=False))
                 newlen = len(delta) - hlen
 
                 if delta[:hlen] != mdiff.replacediffheader(oldlen, newlen):
@@ -666,7 +665,7 @@  class sqlitefilestore(object):
 
             if (not (storeflags & FLAG_CENSORED)
                 and storageutil.deltaiscensored(
-                    delta, baserev, lambda x: len(self.revision(x, raw=True)))):
+                    delta, baserev, lambda x: len(self.rawdata(x)))):
                 storeflags |= FLAG_CENSORED
 
             linkrev = linkmapper(linknode)
@@ -719,7 +718,7 @@  class sqlitefilestore(object):
 
         # This restriction is cargo culted from revlogs and makes no sense for
         # SQLite, since columns can be resized at will.
-        if len(tombstone) > len(self.revision(censornode, raw=True)):
+        if len(tombstone) > len(self.rawdata(censornode)):
             raise error.Abort(_('censor tombstone must be no longer than '
                                 'censored data'))