repoview: extract actual hidden cache writing in its own function

This will allow the generation of this cache within the transaction. Relying on
the transaction will reduce the chance of reader seeing bad cache.
localrepo: add a currenttransaction method

This method returnx the current transaction or None: it will allow a
cache writer to hook in an existing transaction.
push: stop independent usage of bundle2 in syncphase (issue4454)

The phase-syncing code was using bundle2 if the remote supported it. It was
doing so without regard to bundle2 activation on the client. Moreover, the
phase push is now properly included in the unified bundle2 push, so having extra
code in syncphase should be useless. If the remote is bundle2-enabled, the
phases should already be synced.

The buggy verification code was leading to a crash when a 3.2 client was pushing
to a 3.1 server. The real bundle2 path detected that their versions were
incompatible, but the syncphase code failed to, sending an incompatible bundle2
to the server.

We drop the useless and buggy code as a result. The "else" clause is
de-indented in the process.

--HG--
branch : stable
templates: fix broken "less" & "more" links in paper style (issue4460)

"/search", which is an invalid command in hgweb, was mistakenly used for
"[show] more [revsets]" and "[show] less [revsets]" links on search page in
templates "paper" (and those which inherit paper, such as coal) before and
worked fine until 6e1fbcb18a75, which made hgweb more strict about invalid
commands.

--HG--
branch : stable
changegroup: fix file linkrevs during reorders (issue4462)

Previously, if reorder was true during the creation of a changegroup bundle,
it was possible that the manifest and filelogs would be reordered such that the
resulting bundle filelog had a linkrev that pointed to a commit that was not
the earliest instance of the filelog revision. For example:

With commits:

0<-1<---3<-4
  \       /
   --2<---

if 2 and 3 added the same version of a file, if the manifests of 2 and 3 have
their order reversed, but the changelog did not, it could produce a filelog with
linkrevs 0<-3 instead of 0<-2, which meant if commit 3 was stripped, it would
delete that file data from the repository and commit 2 would be corrupt (as
would any future pulls that tried to build upon that version of the file).

The fix is to make the linkrev fixup smarter. Previously it considered the first
manifest that added a file to be the first commit that added that file, which is
not true. Now, for every file revision we add to the bundle we make sure we
attach it to the earliest applicable linkrev.

--HG--
branch : stable
merge: consistently use single quotes for non-user-facing strings

Because I'm getting tired of searching for both 'O' and "O".
merge with stable