revlog: parentdelta flags for revlog index
authorPradeepkumar Gayam <in3xes@gmail.com>
Tue, 10 Aug 2010 22:25:08 +0530
changeset 11928 b69899dbad40
parent 11926 9b842c8fb4df
child 11929 1839a7518b0d
revlog: parentdelta flags for revlog index
mercurial/revlog.py
--- a/mercurial/revlog.py	Tue Aug 17 17:27:37 2010 +0200
+++ b/mercurial/revlog.py	Tue Aug 10 22:25:08 2010 +0530
@@ -34,8 +34,9 @@
 REVLOGNG_FLAGS = REVLOGNGINLINEDATA | REVLOGSHALLOW
 
 # revlog index flags
+REVIDX_PARENTDELTA  = 1
 REVIDX_PUNCHED_FLAG = 2
-REVIDX_KNOWN_FLAGS = REVIDX_PUNCHED_FLAG
+REVIDX_KNOWN_FLAGS = REVIDX_PUNCHED_FLAG | REVIDX_PARENTDELTA
 
 # amount of data read unconditionally, should be >= 4
 # when not inline: threshold for using lazy index
@@ -441,12 +442,16 @@
         self.nodemap = {nullid: nullrev}
         self.index = []
         self._shallowroot = shallowroot
+        self._parentdelta = 0
 
         v = REVLOG_DEFAULT_VERSION
         if hasattr(opener, 'options') and 'defversion' in opener.options:
             v = opener.options['defversion']
             if v & REVLOGNG:
                 v |= REVLOGNGINLINEDATA
+            if v & REVLOGNG and 'parentdelta' in opener.options:
+                self._parentdelta = 1
+
         if shallowroot:
             v |= REVLOGSHALLOW