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.
--- 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