diff mercurial/localrepo.py @ 14333:31a5973fcf96

revlog: get rid of defversion defversion was a property (later option) on the store opener, used to propagate the changelog revlog format to the other revlogs, so they would be created with the same format. This required that the changelog instance was created before any other revlog; an invariant that wasn't directly enforced (or documented) anywhere. We now use the revlogv1 requirement instead, which is transfered to the store opener options. If this option is missing, v0 revlogs are created.
author Sune Foldager <cryo@cyanite.org>
date Mon, 16 May 2011 12:44:34 +0200
parents 01472f8f5429
children 82f3b0f3f0a5
line wrap: on
line diff
--- a/mercurial/localrepo.py	Mon May 16 11:52:28 2011 +0200
+++ b/mercurial/localrepo.py	Mon May 16 12:44:34 2011 +0200
@@ -116,9 +116,9 @@
 
     def _applyrequirements(self, requirements):
         self.requirements = requirements
-        self.sopener.options = {}
-        if 'generaldelta' in requirements:
-            self.sopener.options['generaldelta'] = 1
+        openerreqs = set(('revlogv1', 'generaldelta'))
+        self.sopener.options = dict((r, 1) for r in requirements
+                                           if r in openerreqs)
 
     def _writerequirements(self):
         reqfile = self.opener("requires", "w")
@@ -178,7 +178,6 @@
             p = os.environ['HG_PENDING']
             if p.startswith(self.root):
                 c.readpending('00changelog.i.a')
-        self.sopener.options['defversion'] = c.version
         return c
 
     @propertycache