[PATCH 2 of 4] revlog: clarify which revision is added to 'tested' when using cached delta

Martin von Zweigbergk martinvonz at google.com
Fri Dec 4 23:57:39 CST 2015


# HG changeset patch
# User Martin von Zweigbergk <martinvonz at google.com>
# Date 1449276306 28800
#      Fri Dec 04 16:45:06 2015 -0800
# Node ID 1d2f1904bc0a8e49f80e3be627900fd2e7865ffd
# Parent  7ab358606c379dffd78218a068a66cd2017a3ba5
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.

diff --git a/mercurial/revlog.py b/mercurial/revlog.py
--- a/mercurial/revlog.py
+++ b/mercurial/revlog.py
@@ -1428,7 +1428,7 @@
                 # Assume what we received from the server is a good choice
                 # build delta will reuse the cache
                 candidatedelta = builddelta(cachedelta[0])
-                tested.add(candidatedelta[3])
+                tested.add(cachedelta[0])
                 if self._isgooddelta(candidatedelta, textlen):
                     delta = candidatedelta
             if delta is None and self._generaldelta:


More information about the Mercurial-devel mailing list