[PATCH 5 of 7] checkheads: clarify that we no longer touch the head unknown locally

Pierre-Yves David pierre-yves.david at ens-lyon.org
Sat Jun 3 04:06:28 EDT 2017


# HG changeset patch
# User Pierre-Yves David <pierre-yves.david at octobus.net>
# Date 1496028009 -7200
#      Mon May 29 05:20:09 2017 +0200
# Node ID a1f391628a0df5d08309493544874c4e1c937a9e
# Parent  4c1f8363134c9003412863fd8a97dd8d3ed176fc
# EXP-Topic pushrace
# Available At https://www.mercurial-scm.org/repo/users/marmoute/mercurial/
#              hg pull https://www.mercurial-scm.org/repo/users/marmoute/mercurial/ -r a1f391628a0d
checkheads: clarify that we no longer touch the head unknown locally

Since c6cb21ddf74a, heads unknown locally no longer get any post processing
from obsolescence markers. We clarify this fact by only feeding the list of
locally known new heads to the function. This simplification of the input will
help moving that post-processing earlier in the function.

diff --git a/mercurial/discovery.py b/mercurial/discovery.py
--- a/mercurial/discovery.py
+++ b/mercurial/discovery.py
@@ -340,22 +340,21 @@ def checkheads(pushop):
         allfuturecommon.update(allmissing)
     for branch, heads in sorted(headssum.iteritems()):
         remoteheads, newheads, unsyncedheads = heads
-        candidate_newhs = set(newheads)
         # add unsynced data
         if remoteheads is None:
             oldhs = set()
         else:
             oldhs = set(remoteheads)
         oldhs.update(unsyncedheads)
-        candidate_newhs.update(unsyncedheads)
         dhs = None # delta heads, the new heads on branch
         if not repo.obsstore:
             discardedheads = set()
-            newhs = candidate_newhs
+            newhs = set(newheads)
         else:
             newhs, discardedheads = _postprocessobsolete(pushop,
                                                          allfuturecommon,
-                                                         candidate_newhs)
+                                                         newheads)
+        newhs.update(unsyncedheads)
         unsynced = sorted(h for h in unsyncedheads if h not in discardedheads)
         if unsynced:
             if None in unsynced:


More information about the Mercurial-devel mailing list