[PATCH 5 of 7] localrepo: add parentdelta to requires only if enabled in config file

in3xes at gmail.com in3xes at gmail.com
Tue Aug 10 12:21:14 CDT 2010


# HG changeset patch
# User Pradeepkumar Gayam <in3xes at gmail.com>
# Date 1281459488 -19800
# Node ID 2f40016109791142299e876fe777d976e0785e34
# Parent  bce13b815e6d29320e70600a62f6185e4282547c
localrepo: add parentdelta to requires only if enabled in config file

diff -r bce13b815e6d -r 2f4001610979 mercurial/localrepo.py
--- 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


More information about the Mercurial-devel mailing list