head-checking: ignore obsoleted section when checking head creation locally stable
authorPierre-Yves David <pierre-yves.david@octobus.net>
Mon, 06 Apr 2020 07:26:40 +0200
branchstable
changeset 5273 f560d23639e1
parent 5272 b20d04641c0f
child 5274 fa1324e58fcf
head-checking: ignore obsoleted section when checking head creation locally Same as for the server side check, these do not need to be taken in account.
hgext3rd/evolve/headchecking.py
tests/test-single-head-obsolescence-named-branch-A1.t
tests/test-single-head-obsolescence-named-branch-A3.t
--- a/hgext3rd/evolve/headchecking.py	Wed Mar 11 23:56:11 2020 +0100
+++ b/hgext3rd/evolve/headchecking.py	Mon Apr 06 07:26:40 2020 +0200
@@ -83,7 +83,7 @@
         nh = localcandidate.pop()
         current_branch = branchinfo(pushop, unfi, nh)
         # run this check early to skip the evaluation of the whole branch
-        if torev(nh) in futurecommon or ispublic(torev(nh)):
+        if ispublic(torev(nh)) or not unfi[nh].obsolete():
             newhs.add(nh)
             continue
 
@@ -105,7 +105,9 @@
         # * if we have no markers to push to obsolete it.
         if (
             any(ispublic(torev(n)) for n in branchnodes)
-            or any(torev(n) in futurecommon for n in branchnodes)
+            or (any(torev(n) in futurecommon and not unfi[n].obsolete() for n in branchnodes))
+            # XXX `hasoutmarker` does not guarantee the changeset to be
+            # obsolete, nor obsoleted by the push.
             or any(not hasoutmarker(n) for n in branchnodes)
         ):
             newhs.add(nh)
--- a/tests/test-single-head-obsolescence-named-branch-A1.t	Wed Mar 11 23:56:11 2020 +0100
+++ b/tests/test-single-head-obsolescence-named-branch-A1.t	Mon Apr 06 07:26:40 2020 +0200
@@ -96,9 +96,7 @@
 Actual testing
 --------------
 
-(force push to make sure we get the changeset on the remote)
-
-  $ hg push -r 'desc("B1")' --force
+  $ hg push -r 'desc("B1")'
   pushing to $TESTTMP/A1/server
   searching for changes
   adding changesets
--- a/tests/test-single-head-obsolescence-named-branch-A3.t	Wed Mar 11 23:56:11 2020 +0100
+++ b/tests/test-single-head-obsolescence-named-branch-A3.t	Mon Apr 06 07:26:40 2020 +0200
@@ -104,9 +104,7 @@
 Actual testing
 --------------
 
-(force push to make sure we get the changeset on the remote)
-
-  $ hg push -r 'desc("C1")' --force
+  $ hg push -r 'desc("C1")'
   pushing to $TESTTMP/A3/server
   searching for changes
   adding changesets