merge with stable
run-tests: '--time' option provide more details to Linux users

As our tests execute in child processes, this patch uses os.times()
module in replace of time.time() module to provide additional info like
user time and system time spent by child's processes along with real elapsed
time taken by a process.

There is one limitation of this patch. It can work only for Linux users and
not for Windows.

"os.times" module returns a 5-tuple of a floaing point numbers.
1) User time
2) System time
3) Child's user time
4) Child's system time
5) Ellapsed real time

On Windows, only the first two items are filled, the others are zero.
Therefore, below test cases does not break on Windows but instead gives the
zero value.
test-obsolete: better logging template

Gratuitous improvement of the test readability.
graft: allow regrafting ancestors with --force (issue3220)
graft: make --force apply across continues (issue3220)

Since --force determines the list of revisions to be grafted, it doesn't really
make sense for users to have to keep typing --force --continue as they continue
grafting.
keyword: really clean up kwdemo temp tree
keyword: bump copyright year
purge: prefer util.unlink instead over own removefile
dirstate: add a method to efficiently filter by match

Current callers that require just this data call workingctx.walk, which calls
dirstate.walk, which stats all the files. Even worse, workingctx.walk looks for
unknown files, significantly slowing things down, even though callers might not
be interested in them at all.
context: add a method to efficiently filter by match if possible

For non-working contexts, walk and matches do the same thing. For working
contexts, walk stats all the files and looks for unknown files, while matches
just filters the dirstate by match.
locate: use ctx.matches instead of ctx.walk

On mozilla-central, which is around 100,000 files, best of 5:

$ hg --time locate > /dev/null
before: real 1.460 secs (user 1.140+0.000 sys 0.320+0.000)
after:  real 0.620 secs (user 0.610+0.000 sys 0.020+0.000)

$ hg --time locate README > /dev/null
before: real 0.630 secs (user 0.330+0.000 sys 0.290+0.000)
after:  real 0.120 secs (user 0.110+0.000 sys 0.020+0.000)

Larger repositories see correspondingly larger performance gains.
i18n: detect UI language without POSIX-style locale variable on Windows (BC)

On Windows, it isn't common to set LANG environment variable. This patch makes
gettext honor Windows-style UI language [1] if no locale variables are set.

Because of this change, LANG=C or HGPLAIN must be set in order to disable
translation on non-English Windows.

 [1]: http://msdn.microsoft.com/en-us/library/dd374098(v=VS.85).aspx
wireproto: add a ``boolean`` type for getbundle parameters

This will be used to control inclusion of some parts in a bundle2.
getbundle: add a ``cg`` boolean argument to control changegroup inclusion

The ``getbundle`` function was initially design to return a changegroup bundle.
However, bundle2 allows transmitting a wide range of data. Some bundle2
requests may not include a changegroup at all.

Before this changeset, the client would request a changegroup for
``heads=[nullid]`` and receive an empty changegroup.

We introduce an official boolean parameter, ``cg``, that can be set
to false to disable changegroup generation on getbundle. A new bundle2
capability is introduced to let the client know.
config: allow 'user' in .hgrc ui section (issue3169)
histedit: respect revsetalias entries (issue4311)

We now expand user-provided revsets before using repo.revs() to locate
the root(s) of the user-specified set.
doc: unify help text for "--message" option

This patch changes help text for "--message" option of commands below
for unification.

  - sign (of gpg)
  - tag

This unification reduces translation cost, too.

This patch doesn't change the description for "--message" of "hg
rebase" below, because this should contain "collapse" word to explain
its purpose (only for "--collapse") clearly.

    use text as collapse commit message
doc: unify help text for "--edit" option

This patch changes help text for "--edit" option of commands below:

  - fetch
  - qnew
  - qrefresh
  - qfold
  - commit
  - tag

This unification reduces translation cost, too.

This patch chooses not "further edit commit message already specified"
(of "hg commit") but "invoke editor on commit messages" as unified
help text for "--edit" option, because the latter is much older than
the former.
i18n-pt_BR: synchronized with ad56fc55cbc3
merge with i18n