pushkey: run hook after the lock release
The pushkey operation used to be in its own wireprotocol command and (in
practice) always be lock free when running the hook. With bundle2, it happen in
a greater scheme and a hook running locking command would get stuck. We now run
such hooks after the lock release as similar hook do.
Bundle2 test are altered to ensure we are lockfree at hook running time.
setup: use changes since latest tag instead of just distance
For a Mercurial built on the merge from stable into default right after 3.2.2
was released --
19ebd2f88fc7 -- the version number produced was "3.2.2+4". This
is potentially misleading, since in reality the built Mercurial includes many
more changes compared to 3.2.2.
Change the versioning scheme so that we take into consideration all the changes
present in the current revision that aren't present in the latest tag. For
19ebd2f88fc7 the new versioning scheme results in a version number of
"3.2.2+256". This gives users a much better idea of how many changes have
actually happened since the latest release.
Since changessincelatesttag is always greater than or equal to the
latesttagdistance, this will produce version numbers that are always greater
than or equal to the old scheme. Thus there's minimal compatibility risk.