changeset 11932:01778673aab7

localrepo: add parentdelta to requires only if enabled in config file
author Pradeepkumar Gayam <in3xes@gmail.com>
date Tue, 10 Aug 2010 22:28:08 +0530
parents 6051db1327f8
children 293afcfb66a8
files mercurial/localrepo.py
diffstat 1 files changed, 5 insertions(+), 1 deletions(-) [+]
line wrap: on
line diff
--- a/mercurial/localrepo.py	Tue Aug 10 22:27:41 2010 +0530
+++ b/mercurial/localrepo.py	Tue Aug 10 22:28:08 2010 +0530
@@ -21,7 +21,7 @@
 
 class localrepository(repo.repository):
     capabilities = set(('lookup', 'changegroupsubset', 'branchmap', 'pushkey'))
-    supported = set('revlogv1 store fncache shared'.split())
+    supported = set('revlogv1 store fncache shared parentdelta'.split())
 
     def __init__(self, baseui, path=None, create=0):
         repo.repository.__init__(self)
@@ -55,6 +55,8 @@
                         '\0\0\0\2' # represents revlogv2
                         ' dummy changelog to prevent using the old repo layout'
                     )
+                if self.ui.configbool('format', 'parentdelta', False):
+                    requirements.append("parentdelta")
                 reqfile = self.opener("requires", "w")
                 for r in requirements:
                     reqfile.write("%s\n" % r)
@@ -91,6 +93,8 @@
         self.sjoin = self.store.join
         self.opener.createmode = self.store.createmode
         self.sopener.options = {}
+        if 'parentdelta' in requirements:
+            self.sopener.options['parentdelta'] = 1
 
         # These two define the set of tags for this repository.  _tags
         # maps tag name to node; _tagtypes maps tag name to 'global' or