discovery: avoid wrongly saying there are nothing to pull
We can get in a situation where a revision passed through `hg pull --rev REV`
are available on the server, but not a descendant of the advertised server
heads.
For example the server could lying be during heads advertisement, to hide some
pull request. Or obsolete/hidden content could be explicitly pulled.
So in this case the lookup associated to `REV` returned successfully, but the
normal discovery will find all advertised heads already known locally. This flip
a special boolean `anyinc` that will prevent any fetch attempt, preventing `REV`
to be pulled over.
We add three line of code to detect this case and make sure a pull actually
happens.
My main target is to make some third party extensions happy (I expect the
associated test to move upstream with the extension). However this fix already
make some of the `infinitepush` test happier.
rebase: don't create merge when continuing rebase interrupted by old hg
This fixes the bug described and demonstrated in the previous
commit. It does so by practically undoing
8082a77cc3a2 (rebase: remove
some redundant setting of dirstate parents, 2020-01-10).
Differential Revision: https://phab.mercurial-scm.org/D8356
tests: demonstrate how continuing rebase after upgrade can result in merge
If the user starts a rebase with an hg version before
9c9cfecd4600
(rebase: don't use rebased node as dirstate p2 (BC), 2020-01-10) and
then runs into conflicts, they will be dropped out to the shell with
the rebased node set as the dirstate's second parent. If they then
upgrade to a later hg version, it will respect the dirstate's parents
and will create a merge commit even if the user was rebasing a
non-merge commit.
Differential Revision: https://phab.mercurial-scm.org/D8355