Patchwork [2,of,3,V3] revlog: add instance variable controlling delta chain use

login
register
mail settings
Submitter Gregory Szorc
Date Oct. 13, 2016, 7:44 p.m.
Message ID <aed87a8bed99b373eec5.1476387889@gps-mbp.local>
Download mbox | patch
Permalink /patch/17066/
State Accepted
Headers show

Comments

Gregory Szorc - Oct. 13, 2016, 7:44 p.m.
# HG changeset patch
# User Gregory Szorc <gregory.szorc@gmail.com>
# Date 1474745137 25200
#      Sat Sep 24 12:25:37 2016 -0700
# Node ID aed87a8bed99b373eec5fb09dd2f76d166af59e8
# Parent  4c98fccd5b70d2f89fe48bdb81288448daed758c
revlog: add instance variable controlling delta chain use

This is to support disabling delta chains on the changelog in a
subsequent patch.

Patch

diff --git a/mercurial/revlog.py b/mercurial/revlog.py
--- a/mercurial/revlog.py
+++ b/mercurial/revlog.py
@@ -296,8 +296,10 @@  class revlog(object):
         elif fmt > REVLOGNG:
             raise RevlogError(_("index %s unknown format %d")
                               % (self.indexfile, fmt))
 
+        self._storedeltachains = True
+
         self._io = revlogio()
         if self.version == REVLOGV0:
             self._io = revlogoldio()
         try:
@@ -1468,9 +1470,9 @@  class revlog(object):
         else:
             textlen = len(text)
 
         # should we try to build a delta?
-        if prev != nullrev:
+        if prev != nullrev and self._storedeltachains:
             tested = set()
             # This condition is true most of the time when processing
             # changegroup data into a generaldelta repo. The only time it
             # isn't true is if this is the first revision in a delta chain