mq: refactor usage of repo.branchmap().iteritems() with itervalues()
largefiles: make the protocol hack for replacing heads with lheads more precise

Before the hack would replace 'heads' with 'lheads' no matter where it occured
in a batch command string.

Instead we will use a regexp to more carefully only match the 'heads' commands.
largefiles: refactor basestore, extract _gethash method
commands: refactor 'serve', extract the http service class
i18n-ru: fix the language team field

Having this at the default value caused some versions of msgfmt to
give fatal errors.
i18n: fix wrong rst syntax

Fix syntax errors like wrong indentation and invalid quotation.
All errors preventing to generate valid html documentation (by gendoc.py) are
fixed.
tests: really test translations for rst syntax errors (issue4003)

The variable LC_ALL did not work, use LANGUAGE instead. Before this patch, the
original language C was generated (and tested) in every run.
tests: test-gendoc.t checks if anything was translated

This would triggered when the variable would be set wrong again.
tests: prepare rebase test for wc parent preservation

In the way to solving issue3813 we'll preserve the working directory parent
after the rebase. Multiple rebases test expect the working directory parent to
be tip after rebase. We patches them before the actual change to prevent
confusion.
rebase: preserve working directory parent (BC)

Prior to this changeset, rebase always left the working directory as a parent of
the last rebased changeset. The is dubious when, before the rebase, the working
directory was not a parent of the tip most rebased changeset.

With this changeset, we move the working directory back to its original parent.
If the original parent was rebased, we use it's successors.

This is a step toward solving issue3813 (rebase loses active bookmark if it's
not on a head)
rebase: preserve active bookmark when not at head (issue3813)

Now that the working directory parent is preserved, we can preserve the active
bookmark too.