Patchwork [5,of,6] revlog: make getcandidaterevs more consistent about updating tested revs set

login
register
mail settings
Submitter Paul Morelle
Date May 21, 2018, 9:47 p.m.
Message ID <fbb85c011ea4c6ba474d.1526939277@belenos.localdomain>
Download mbox | patch
Permalink /patch/31798/
State Accepted
Headers show

Comments

Paul Morelle - May 21, 2018, 9:47 p.m.
# HG changeset patch
# User Paul Morelle <paul.morelle@octobus.net>
# Date 1520417422 -3600
#      Wed Mar 07 11:10:22 2018 +0100
# Node ID fbb85c011ea4c6ba474dbe616f63543cffb5f909
# Parent  3270177368354d88aba86d5b00b96b7fecadd65b
# EXP-Topic semi-snapshots
# Available At https://bitbucket.org/octobus/mercurial-devel/
#              hg pull https://bitbucket.org/octobus/mercurial-devel/ -r fbb85c011ea4
revlog: make getcandidaterevs more consistent about updating tested revs set

Like in previous cases, update the set of tested revisions after yielding

Patch

diff -r 327017736835 -r fbb85c011ea4 mercurial/revlog.py
--- a/mercurial/revlog.py	Wed Mar 07 12:00:58 2018 +0100
+++ b/mercurial/revlog.py	Wed Mar 07 11:10:22 2018 +0100
@@ -331,13 +331,14 @@ 
                     # Pick whichever parent is closer to us (to minimize the
                     # chance of having to build a fulltext).
                     parents = [max(parents)]
+                yield parents
                 tested.update(parents)
-                yield parents
 
             if prev not in tested:
                 # other approach failed try against prev to hopefully save us a
                 # fulltext.
                 yield (prev,)
+                tested.add(prev)
 
     def buildtext(self, revinfo, fh):
         """Builds a fulltext version of a revision