changegroup: add a "packermap" dictionary to track different packer versions

We only have "01" right now, but we should get general delta in soon.
Bundle2 is expected to make use of this to advertise and select the right packer
to use on both sides.
bundle2caps: advertise the available versions for changegroup packer

This will let the bundle2 client and server detect what packer they should be using.

This detection part is not done. I expect it to be done with the addition of the
second packer (with generaldelta support).
bundle2: support a "version" argument in `changegroup` part

When included, this mandatory parameter (mandatory == cannot be ignored) lets the
part handler select the right cgunpacker class.

--HG--
extra : rebase_source : 8f15c919177a691c568dadc29bed4800ab766270
templater: don't overwrite the keyword mapping in runsymbol() (issue4362)

This keyword remapping was introduced in e06e9fd2d99f as part of converting
generator based iterators into list based iterators, mentioning "undesired
behavior in template" when a generator is exhausted, but doesn't say what and
introduces no tests.

The problem with the remapping was that it corrupted the output for keywords
like 'extras', 'file_copies' and 'file_copies_switch' in templates such as:

    $ hg log -r 142b5d5ec9cc --template "{file_copies % ' File: {file_copy}\n'}"
    File: mercurial/changelog.py (mercurial/hg.py)
    File: mercurial/changelog.py (mercurial/hg.py)
    File: mercurial/changelog.py (mercurial/hg.py)
    File: mercurial/changelog.py (mercurial/hg.py)
    File: mercurial/changelog.py (mercurial/hg.py)
    File: mercurial/changelog.py (mercurial/hg.py)
    File: mercurial/changelog.py (mercurial/hg.py)
    File: mercurial/changelog.py (mercurial/hg.py)

What was happening was that in the first call to runtemplate() inside runmap(),
'lm' mapped the keyword (e.g. file_copies) to the appropriate showxxx() method.
On each subsequent call to runtemplate() in that loop however, the keyword was
mapped to a list of the first item's pieces, e.g.:

   'file_copy': ['mercurial/changelog.py', ' (', 'mercurial/hg.py', ')']

Therefore, the dict for the second and any subsequent items were not processed
through the corresponding showxxx() method, and the first item's data was
reused.

The 'extras' keyword regressed in de7e6c489412, and 'file_copies' regressed in
0b241d7a8c62 for other reasons.  The common thread of things fixed by this seems
to be when a list of dicts are passed to the templatekw._hybrid class.

--HG--
branch : stable
perf: use a formatter for output

We use a `formatter` object in the perf extensions. This allow the use of
formatted output like json. To avoid adding logic to create a formatter and pass
it around to the timer function in every command, we add a `gettimer` function
in charge of returning a `timer` function as simple as before but embedding an
appropriate formatter.

This new `gettimer` function also return the formatter as it needs to be
explicitly closed at the end of the command.

example output:


  $ hg --config ui.formatjson=True perfvolatilesets visible obsolete
  [
   {
    "comb": 0.02,
    "count": 126,
    "sys": 0.0,
    "title": "obsolete",
    "user": 0.02,
    "wall": 0.0199398994446
   },
   {
    "comb": 0.02,
    "count": 117,
    "sys": 0.0,
    "title": "visible",
    "user": 0.02,
    "wall": 0.0250301361084
   }
  ]

--HG--
extra : rebase_source : 1fccdb02e643c7aa76d18c191cb903804834cf95
tests: write hgrc of more than two lines by using shell heredoc

Here document should be readable than repeating echo commands.

--HG--
extra : rebase_source : f01d619976f396a9e5a8a7fd6449b0d3b03cdc41
patchbomb: add label and color to the confirm output

The current output is mostly a wall of text. This makes it hard to
actually check something for people with lazy eyes. We use labels and
colors to make it more joyful (and get the patch summaries to stand
out). The colors have been arbitrarily choosen. They can be changed
later if someone has a more scientific choice.

--HG--
extra : rebase_source : 90c05c8721abbf070646852b8ebc152dd65ca1bc
win32: fix win32 installers generation

cd0c51c07e5f introduced a typo preventing a proper generation of the
installers. Also remove ConcatenateFiles() function as it is no more
required.

--HG--
extra : rebase_source : 01cef237eb61163c27a282bbbb7f4dfb4603ad06
win32: remove Mercurial.ini file from Inno Setup installer (issue4435)

--HG--
extra : rebase_source : 2e3cb0bc5e7015f2879058d54008196aab03a3df
merge with stable