test-bundle2: add obsolescence information to be exchanged

To introduce a bundle2 way to exchange obsolescence markers, we need to
have some information available to exchange. Introduce markers relevant
to changesets involved in the exchange. The new markers reference the
changesets as successor nodes of clowny (nonexistent) hashes so that
other than being exchanged they have no effect.

We introduce them in two waves as push is expected to be smart about the
number of markers it exchanges sooner than pull.

--HG--
extra : rebase_source : 8fc6698d9db30750f995f0f380f4ce8ad57bfc62
obsstore: have the `mergemarkers` method return the number of new markers

The mergemarkers function now returns the number of unknown markers in
the stream that have been added to the obsstore. This is similar to what
`obsstore.add` already does.

The method gains a docstring in the process.
obsolete: rename _fnodesize to _fmfnodesize

All variables involved in the obsstore format are prefixed with `_fm`.
`_fnodesize` was the exception. It is now back in line.

This is meaningful as we'll need to distinguish between multiple versions of the
obsstore format.

--HG--
extra : rebase_source : 9e172453ff66d2b76c77a2a705efaefaab432d21
obsolete: rename all _fm to _fm0

This change is because these formats are used for version 0 of the
obsstore format. This is going to be useful in the future when we
introduce new versions of the format.

--HG--
extra : rebase_source : 49ed2d30e55a3b893b0aab9b1dce3e35a7c488bf
obsolete: extract the part of _readmarkers specific to format version 0

If we are to introduce new formats we need to be able call different
functions for different formats. Creating a function for format
version 0 is the first step.

--HG--
extra : rebase_source : cef3bc0e673086ad2933c8dfbee930cfb9eecc92
obsolete: rename _encodeonemarker to _fm0encodeonemarkers

This function encodes markers in version 0 of the format.

--HG--
extra : rebase_source : 90b3c73885fbab544b8bed9a16efca4173d6255d
obsolete: move _fm0encodeonemarker next to _fm0readmarkers

--HG--
extra : rebase_source : 7bd28859b81d3a7d1152aee2c409d526957b1ec9
obsolete: support for any known obsstore format when reading or writing

We can now read and write any known format. The list of known formats
currently has one element (0). The obsstore itself is not aware of
multiple formats yet and always uses format 0.

--HG--
extra : rebase_source : 56f30af10ea2f1778fcf0a73ba04fdf07da0a8b8
obsolete: have _readmarkers return the format version

readmarkers is not returning the version of the format it read from. This will
let callers know about the format and allow them to preserve it.

--HG--
extra : rebase_source : 6d72fa5794a9d16b79e333275008119c6ae3bd11
obsstore: store and preserve ondisk version

--HG--
extra : rebase_source : 85eedb358b22987e119302c894c86c7722884666
obsolete: move _encodemarkers next to _readmarkers

--HG--
extra : rebase_source : 3da53ffcbcea0a737fc78e614ade6f3533a29df9
obsolete: make encodemarkers a public function

We'll need access to it for bundle2.

--HG--
extra : rebase_source : 72faa3287e4c49eeb2ec4bda4c5c6c31a538f55a
bundle2: add an obsmarkers part handler

This part contains a binary stream of obsolescence markers. Received markers are
added to the repository.
obsmarker: write a message with the number of markers added through bundle2

--HG--
extra : rebase_source : 2fe6d13792798690b02f3b9753de42b01307b7d0
obssmarker: add a bundle2 record with the number of markers added

--HG--
extra : rebase_source : c3c4e493614f19339fd9b5581ac279aa190a21b4
obsmarker: record the number of new markers in the transaction

This lets hooks be notified about new markers in the repository.

--HG--
extra : rebase_source : e30309c17d2feeb7fbec724cce352efe85e93df6
obsmarker: produce a reply part for markers received through bundle2

--HG--
extra : rebase_source : 64dd21a611763ccaacbe764e5cdae899d35127c2
obsmarker: move bundle2caps from the localrepo class to the bundle2 module

The localrepo path was quicker, easier, more seductive. We'll soon add a
function in another changeset to alter the capabilities.

--HG--
extra : rebase_source : daaa6c66300cc6ced1336ffa30c43d36ee328090
bundle2: introduce a `getrepocaps` to retrieve the bundle2 caps of a repo

This function lets extensions change the bundle2 capabilities of a repository.

--HG--
extra : rebase_source : 1bfa530007ce33b1dfd0454dd05ce15b2f269432
bundle2: advertise the obsmarker part in bundle2 capabilities

--HG--
extra : rebase_source : 3959ae09d945da391ffa7944be3c7f47b8a12fd1