Mercurial > public > mercurial-scm > hg-stable
comparison mercurial/revlog.py @ 39183:f39efa885a6d
revlog: also detect intermediate snapshots
Also detect intermediate-snapshot done against another previous snapshot.
Doing an intermediate snapshot instead of a full one can reduce the number of
full snapshots we need. They are especially useful for content with a lot of
churn on the same line (eg: the manifest) where having a delta over multiple
revisions can end up being significantly smaller than the sum of these
revision deltas.
A revlog built using intermediate snapshots can be a bit smaller and reuse
snapshot much more efficiently. This last property is useful combined with
constraints on chain length. Using intermediate snapshot can produce
repository with delta chain ten times shorter without impact on the storage
size. Shorter chain lengths are faster to restore, greatly improving read
performance.
This changesets (and the following ones) focus on getting the core principle
of intermediate snapshots into Mercurial core. Later changeset will introduce
the strategy to create them.
author | Paul Morelle <paul.morelle@octobus.net> |
---|---|
date | Fri, 20 Jul 2018 13:34:48 +0200 |
parents | f8db458651c8 |
children | 3b1042cab4b4 |
comparison
equal
deleted
inserted
replaced
39182:f8db458651c8 | 39183:f39efa885a6d |
---|---|
2101 if rev == nullrev: | 2101 if rev == nullrev: |
2102 return True | 2102 return True |
2103 deltap = self.deltaparent(rev) | 2103 deltap = self.deltaparent(rev) |
2104 if deltap == nullrev: | 2104 if deltap == nullrev: |
2105 return True | 2105 return True |
2106 return False | 2106 p1, p2 = self.parentrevs(rev) |
2107 if deltap in (p1, p2): | |
2108 return False | |
2109 return self.issnapshot(deltap) | |
2107 | 2110 |
2108 def revdiff(self, rev1, rev2): | 2111 def revdiff(self, rev1, rev2): |
2109 """return or calculate a delta between two revisions | 2112 """return or calculate a delta between two revisions |
2110 | 2113 |
2111 The delta calculated is in binary form and is intended to be written to | 2114 The delta calculated is in binary form and is intended to be written to |