Mercurial > public > mercurial-scm > hg-stable
comparison mercurial/revlog.py @ 27249:0e5aab543d85
revlog: clarify which revision is added to 'tested' when using cached delta
The tested delta revisions are added to the 'tested' set. These are
the same revisions we pass to builddelta(). However, in one case, we
add builddelta(rev)[3] to the set intead of adding 'rev' itself. In
that particular case, that element is the same as the function's input
revision (because self._generaldelta is true), so the effect is the
same. Still, let's just add the function's input revision to avoid
confusing future readers.
author | Martin von Zweigbergk <martinvonz@google.com> |
---|---|
date | Fri, 04 Dec 2015 16:45:06 -0800 |
parents | 0d5fe81320a9 |
children | bff71fe05768 |
comparison
equal
deleted
inserted
replaced
27248:0d5fe81320a9 | 27249:0e5aab543d85 |
---|---|
1426 tested = set() | 1426 tested = set() |
1427 if cachedelta and self._generaldelta and self._lazydeltabase: | 1427 if cachedelta and self._generaldelta and self._lazydeltabase: |
1428 # Assume what we received from the server is a good choice | 1428 # Assume what we received from the server is a good choice |
1429 # build delta will reuse the cache | 1429 # build delta will reuse the cache |
1430 candidatedelta = builddelta(cachedelta[0]) | 1430 candidatedelta = builddelta(cachedelta[0]) |
1431 tested.add(candidatedelta[3]) | 1431 tested.add(cachedelta[0]) |
1432 if self._isgooddelta(candidatedelta, textlen): | 1432 if self._isgooddelta(candidatedelta, textlen): |
1433 delta = candidatedelta | 1433 delta = candidatedelta |
1434 if delta is None and self._generaldelta: | 1434 if delta is None and self._generaldelta: |
1435 parents = [p1r, p2r] | 1435 parents = [p1r, p2r] |
1436 # exclude already lazy tested base if any | 1436 # exclude already lazy tested base if any |