The actual validation is in bundle2.handlebookmark.
The rest of the changes are there to pass the force parameter.
I've also made force available to hooks. That way one can validate who can and cannot use --force on a shared repo.
In other words, in the case of:
o 2 | o 1 @ o/ 0
when I last pulled, @ was on 0, and now I'm doing hg push -B @, but
since my last pull the server advanced @ to 2, meaning it's a
non-linear update of the bookmark. This used to be allowed, and is now
prohibited without --force.
.. bc::
`hg push --bookmark` and `hg push -B` no longer move a bookmark during push if the new bookmark position isn't a descendant of the current bookmark position.
.. feature::
Hooks are now able to tell if --force was specified when a bookmark was pushed.
Hm, I think conflicts can be confusing but I don't have better suggestions here.