diff mercurial/localrepo.py @ 2073:1e6745f78989

Implement data inlined with the index file This patch allows you to optionally inline data bytes with the revlog index file. It saves considerable space and checkout time by reducing the number of inodes, wasted partial blocks and system calls. To use the inline data add this to your .hgrc [revlog] # inline data only works with revlogng format=1 # inline is the only valid flag right now. flags=inline
author mason@suse.com
date Tue, 04 Apr 2006 16:38:43 -0400
parents 74d3f5336b66
children 343aeefb553b
line wrap: on
line diff
--- a/mercurial/localrepo.py	Tue Apr 04 16:38:43 2006 -0400
+++ b/mercurial/localrepo.py	Tue Apr 04 16:38:43 2006 -0400
@@ -43,12 +43,23 @@
 
         v = self.ui.revlogopts
         self.revlogversion = int(v.get('format', 0))
+        flags = 0
         for x in v.get('flags', "").split():
-            self.revlogversion |= revlog.flagstr(x)
+            flags |= revlog.flagstr(x)
+
+        v = self.revlogversion | flags
+        self.manifest = manifest.manifest(self.opener, v)
+        self.changelog = changelog.changelog(self.opener, v)
 
-        self.manifest = manifest.manifest(self.opener, self.revlogversion)
-        self.changelog = changelog.changelog(self.opener, self.revlogversion)
-        self.revlogversion = self.changelog.version
+        # the changelog might not have the inline index flag
+        # on.  If the format of the changelog is the same as found in
+        # .hgrc, apply any flags found in the .hgrc as well.
+        # Otherwise, just version from the changelog
+        v = self.changelog.version
+        if v == self.revlogversion:
+            v |= flags
+        self.revlogversion = v
+
         self.tagscache = None
         self.nodetagscache = None
         self.encodepats = None