revlog: remove support for parentdelta
We will introduce a more powerful and general delta concept instead,
called generaldelta.
--- a/mercurial/localrepo.py Wed May 04 12:58:59 2011 +0200
+++ b/mercurial/localrepo.py Thu May 05 12:55:12 2011 +0200
@@ -21,7 +21,7 @@
class localrepository(repo.repository):
capabilities = set(('lookup', 'changegroupsubset', 'branchmap', 'pushkey',
'known', 'getbundle'))
- supportedformats = set(('revlogv1', 'parentdelta'))
+ supportedformats = set(('revlogv1',))
supported = supportedformats | set(('store', 'fncache', 'shared',
'dotencode'))
@@ -61,8 +61,6 @@
'\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")
else:
raise error.RepoError(_("repository %s not found") % path)
elif create:
@@ -117,8 +115,6 @@
def _applyrequirements(self, requirements):
self.requirements = requirements
self.sopener.options = {}
- if 'parentdelta' in requirements:
- self.sopener.options['parentdelta'] = 1
def _writerequirements(self):
reqfile = self.opener("requires", "w")
--- a/mercurial/revlog.py Wed May 04 12:58:59 2011 +0200
+++ b/mercurial/revlog.py Thu May 05 12:55:12 2011 +0200
@@ -34,9 +34,8 @@
REVLOGNG_FLAGS = REVLOGNGINLINEDATA | REVLOGSHALLOW
# revlog index flags
-REVIDX_PARENTDELTA = 1
REVIDX_PUNCHED_FLAG = 2
-REVIDX_KNOWN_FLAGS = REVIDX_PUNCHED_FLAG | REVIDX_PARENTDELTA
+REVIDX_KNOWN_FLAGS = REVIDX_PUNCHED_FLAG
# max size of revlog with inline data
_maxinline = 131072
@@ -223,7 +222,6 @@
self._chunkcache = (0, '')
self.index = []
self._shallowroot = shallowroot
- self._parentdelta = 0
self._pcache = {}
self._nodecache = {nullid: nullrev}
self._nodepos = None
@@ -233,8 +231,6 @@
v = opener.options['defversion']
if v & REVLOGNG:
v |= REVLOGNGINLINEDATA
- if v & REVLOGNG and 'parentdelta' in opener.options:
- self._parentdelta = 1
if shallowroot:
v |= REVLOGSHALLOW
@@ -834,11 +830,8 @@
self._chunkcache = (0, '')
def deltaparent(self, rev):
- """return previous revision or parentrev according to flags"""
- if self.flags(rev) & REVIDX_PARENTDELTA:
- return self.parentrevs(rev)[0]
- else:
- return rev - 1
+ """return deltaparent of the given revision"""
+ return rev - 1
def revdiff(self, rev1, rev2):
"""return or calculate a delta between two revisions"""
@@ -870,16 +863,10 @@
# build delta chain
chain = []
- index = self.index # for performance
iterrev = rev
- e = index[iterrev]
while iterrev != base and iterrev != cachedrev:
chain.append(iterrev)
- if e[0] & REVIDX_PARENTDELTA:
- iterrev = e[5]
- else:
- iterrev -= 1
- e = index[iterrev]
+ iterrev -= 1
chain.reverse()
base = iterrev
@@ -1018,11 +1005,6 @@
# should we try to build a delta?
if prev != nullrev:
d = builddelta(prev)
- if self._parentdelta and prev != p1r:
- d2 = builddelta(p1r)
- if d2 < d:
- d = d2
- flags = REVIDX_PARENTDELTA
dist, l, data, base = d
# full versions are inserted when the needed deltas