[PATCH STABLE] revlog: make sure we never use sparserevlog without general delta (issue6056)

Boris Feld boris.feld at octobus.net
Fri Jan 25 20:00:52 UTC 2019


# HG changeset patch
# User Boris Feld <boris.feld at octobus.net>
# Date 1548372167 18000
#      Thu Jan 24 18:22:47 2019 -0500
# Branch stable
# Node ID c7661fdcaeac457aa5b8ae6b6a10b259713934b9
# Parent  26ee61c33dee366576a0f7266fea9834985e78ec
# EXP-Topic issue6056
# Available At https://bitbucket.org/octobus/mercurial-devel/
#              hg pull https://bitbucket.org/octobus/mercurial-devel/ -r c7661fdcaeac
revlog: make sure we never use sparserevlog without general delta (issue6056)

We are getting user report where the delta code tries to use `sparse-revlog`
logic on repository where `generaldelta` is disabled. This can't work so we
ensure the two booleans have a consistent value.

Creating this kind of repository is not expected to be possible and we weren't
able to create one for testing purpose. But if users run into this, we better
put stronger protection.

diff --git a/mercurial/revlog.py b/mercurial/revlog.py
--- a/mercurial/revlog.py
+++ b/mercurial/revlog.py
@@ -497,6 +497,9 @@ class revlog(object):
         else:
             raise error.RevlogError(_('unknown version (%d) in revlog %s') %
                                     (fmt, self.indexfile))
+        # sparse-revlog can't be on without general-delta (issue6056)
+        if not self._generaldelta:
+            self._sparserevlog = False
 
         self._storedeltachains = True
 


More information about the Mercurial-devel mailing list