changeset 14334:85c82ebc96a3

changelog: don't use generaldelta
author Sune Foldager <cryo@cyanite.org>
date Mon, 16 May 2011 13:06:48 +0200
parents 31a5973fcf96
children 220f31030e7f
files mercurial/changelog.py mercurial/revlog.py
diffstat 2 files changed, 6 insertions(+), 0 deletions(-) [+]
line wrap: on
line diff
--- a/mercurial/changelog.py	Mon May 16 12:44:34 2011 +0200
+++ b/mercurial/changelog.py	Mon May 16 13:06:48 2011 +0200
@@ -100,6 +100,10 @@
 class changelog(revlog.revlog):
     def __init__(self, opener):
         revlog.revlog.__init__(self, opener, "00changelog.i")
+        if self._initempty:
+            # changelogs don't benefit from generaldelta
+            self.version &= ~revlog.REVLOGGENERALDELTA
+            self._generaldelta = False
         self._realopener = opener
         self._delayed = False
         self._divert = False
--- a/mercurial/revlog.py	Mon May 16 12:44:34 2011 +0200
+++ b/mercurial/revlog.py	Mon May 16 13:06:48 2011 +0200
@@ -234,12 +234,14 @@
                 v = 0
 
         i = ''
+        self._initempty = True
         try:
             f = self.opener(self.indexfile)
             i = f.read()
             f.close()
             if len(i) > 0:
                 v = struct.unpack(versionformat, i[:4])[0]
+                self._initempty = False
         except IOError, inst:
             if inst.errno != errno.ENOENT:
                 raise