Mercurial > public > mercurial-scm > hg
comparison mercurial/revlog.py @ 49476:5846bc8a2855
revlog: finer computation of "issnapshot"
If the parent had an empty diff, we skip of it to compute a diff against the
parent base. This create shorter and simpler chain.
However these case could be wrongly detected as snapshot. So we improve the code
doing this detection.
In practice nobody care as when tried on a copy of mozilla-try and we got the
same number of snapshot (1315) in both case.
Performance where equivalent.
author | Pierre-Yves David <pierre-yves.david@octobus.net> |
---|---|
date | Fri, 20 May 2022 11:02:52 +0100 |
parents | 5fe7e9eda0f3 |
children | 8d6c8a9a91f8 |
comparison
equal
deleted
inserted
replaced
49475:d513ae93dff3 | 49476:5846bc8a2855 |
---|---|
1773 if base == rev: | 1773 if base == rev: |
1774 return True | 1774 return True |
1775 if base == nullrev: | 1775 if base == nullrev: |
1776 return True | 1776 return True |
1777 p1 = entry[5] | 1777 p1 = entry[5] |
1778 while self.length(p1) == 0: | |
1779 b = self.deltaparent(p1) | |
1780 if b == p1: | |
1781 break | |
1782 p1 = b | |
1778 p2 = entry[6] | 1783 p2 = entry[6] |
1784 while self.length(p2) == 0: | |
1785 b = self.deltaparent(p2) | |
1786 if b == p2: | |
1787 break | |
1788 p2 = b | |
1779 if base == p1 or base == p2: | 1789 if base == p1 or base == p2: |
1780 return False | 1790 return False |
1781 return self.issnapshot(base) | 1791 return self.issnapshot(base) |
1782 | 1792 |
1783 def snapshotdepth(self, rev): | 1793 def snapshotdepth(self, rev): |