graphlog: don't truncate template value at last \n

Most uses of templates requires a trailing newline to get vertical output.

Graphlog with a template without trailing newline did however not just create
horisontal output like other commands would but truncated the output at the
last \n. Template values without any \n were ignored completely.

Graphlog will now only eat one trailing newline before it lets the flow of the
graph add the necessary vertical space.

--HG--
extra : rebase_source : 3f18121a540243c8bdb32847774e9fe565b7b6a6
setup: disable -mno-cygwin if building under mingw32

This gcc option has been deprecated since at least 2009 (gcc 4.4),
and it causes compilations to fail entirely with gcc 4.6.x.

Upstream distutils bug: http://bugs.python.org/issue12641
Merge
debugobsolete: remove spurious ctx from variable name

'contexts' are objects like the ones described in context.py, not
anything that describes a situation.
obsolete: move obsolete markers read/write logic to obsstore object

This is the first step toward incremental writing of obsolete marker within a
transaction.

For this purpose, obsstore is now given its repo sopener. This make it able to
handles read and write to the obsstore file itself. Most IO logic is removed
from localrepo and handled by obsstore object directly.
obsolete: append new markers to obsstore file instead of rewriting everything

This is the second step toward incremental writing of marker inside a
transaction. The obsstore file is now handled append only.

Header writing have been extracted from _writemarkers.

Because the _writemarkers method have been dropped, the push code
directly reuse the serialised content of local repo `listkeys`. This
is not very pretty, but this part of the protocol still need major
improvement anyway.
obsolete: write obsolete marker inside a transaction

Marker are now written as soon as possible but within a transaction. Using a
transaction ensure a proper behavior on error and rollback compatibility.

Flush logic are not necessary anymore and are dropped from lock release.

With this changeset, the obsstore is open, written and closed for every single
added marker. This is expected to be highly inefficient and batched write should
be implemented "quickly".

Another issue is that every flush of the file will invalidate the obsstore
filecache and trigger a full re instantiation of the repo.obsstore attribute
(including, reading and parsing entry). This is also expected to be highly
inefficient and proper filecache operation should be implemented "quickly" too.

A side benefit of the filecache issue is that repo.obsstore  object is properly
invalidated on transaction abortion.
largefiles: batch statlfile requests when pushing a largefiles repo (issue3386)

This implements a part of issue 3386.  It batches the request for the status of
all largefiles in the revisions that are about to be pushed into a single
request, instead of doing N separate requests.

In a real world test case, this change was verified to save 1,116 round-trips to
the server.  It only requires a client-side change; it is backwards-compatible
with an older version of the server.
revlog: make compress a method

This allows an extension to optionally use a new compression type based
on the options applied by the repo to the revlog's opener.

(decompress doesn't need the same treatment, as it can be replaced using
extensions.wrapfunction, and can figure out which compression algorithm
is in use based on the first byte of the compressed payload.)
histedit: replace hexshort lambda with node.short
histedit: don't crash if the result of fixing up a fold is empty
histedit: add extension docstring from external README

Made a couple of tweaks to try and fit better with the hg docstring
style and fix up some ReST errors in the README.