ui: separate option to show prompt echo, enabled only in tests (issue4417)

The problem in commandserver was addressed by 524b786bd54f, but it is tricky
to reuse ui.nontty option to disable echo back.  Instead, this patch introduces
new option to enable echoing of prompt response.

Prompt echoing is changed to be off by default, which should avoid possible
breakage of output parsing in user scripts.

For now, this option is undocumented because it exists for internal use.

--HG--
branch : stable
tests: adjust expected prompt choice outputs in test-record.t for Windows

Changeset 9ab18a912c44 introduced "showing prompt choice if input is
not a tty but is forced to be interactive" and adjusted expected
output in test-record.t.

But some tests for no-execbit platform (= Windows) were not adjusted
by 9ab18a912c44.

This causes unexpected failure of test-record on Windows environment.

This patch adds below to prompt lines for such tests:

  - prompt choice at the end of prompt line, and
  - empty line after prompt line

--HG--
branch : stable
tests: add "(glob)" to paths in test-url-rev.t for Windows

--HG--
branch : stable
tests: add "(glob)" to paths in test-hgrc.t for Windows

--HG--
branch : stable
tests: add "(glob)" to paths in test-revset-outgoing.t for Windows

--HG--
branch : stable
tests: add "(glob)" for l10n messages in test-largefiles-update.t for Windows

This patch follows the style of other tests avoiding same kind of issue.

--HG--
branch : stable
tests: add "(glob)" for l10n messages in test-clone.t for Windows

This patch follows the style of other tests avoiding same kind of issue.

--HG--
branch : stable
tests: open file in binary mode to use POSIX end-of-line style anywhere

Before this patch, "test-context.py" fails on Windows environment,
because "diff" output contains unexpected "\r" character.

Opening the target file in text mode causes this automatic end-of-line
conversion.

--HG--
branch : stable
revset: avoid recalculating filesets

This fixes a regression in 8dabcc889e33 that moved matcher building
into a callback, thus causing it be rebuilt for each revision matched
against.

--HG--
branch : stable
revset: have rev() drop out-of-range or filtered rev explicitly (issue4396)

The recent optimization of "and" operation relies on the assumption that
the rhs set does not contain invalid revisions.  So rev() has to remove
invalid revisions.

This is still faster than using `.filter(lambda r: r == l)`.

revset #0: rev(25)
0) wall 0.026341 comb 0.020000 user 0.020000 sys 0.000000 (best of 113)
1) wall 0.000038 comb 0.000000 user 0.000000 sys 0.000000 (best of 66567)
2) wall 0.000062 comb 0.000000 user 0.000000 sys 0.000000 (best of 43699)
(0: bbf4f3dfd700^, 1: 3.2-rc, 2: this patch)

--HG--
branch : stable
extra : rebase_source : 231a4f6c08b6bb5525106b5340bca437abc95cb1
transactions: fix hg recover with fncache backups

The transaction backupfiles logic was broken for 'hg recover'.  The file format
is XXX\0XXX\0YYY\0YYY\0 but the parser did a couple things wrong. 1) It went one
step beyond the final \0 and tried to read past the end of the array. 2)
array[i:i+1] returns a single item, instead of two items as intended.

Added a test to catch it, which turns out to be the first actual 'hg recover'
test.

--HG--
branch : stable
extra : rebase_source : e3cf0a29709409a7de70205d416325e0240d283c
transactions: add version number to journal.backupfiles

The transaction format will be changing a bit over the next releases, so let's
go ahead and add a version number to make backwards compatibility easier. This
whole file format was broken prior to 3.2 (see previous patch), so changing it
now is pretty low risk.

--HG--
branch : stable
extra : rebase_source : c76b65a11fb16985449a645848e9e7987d2c6672
transactions: change backupfiles format to use newlines

Previously the journal.backupfiles file was delimited by \0. Now we delimit it
using \n (same as the journal file). This allows us to change the number of
values in each line more easily, rather than relying on the count of \0's.

--HG--
branch : stable
extra : rebase_source : 344a288fa4196252c77ade50a3210f6052acf94d
bundle2: add a interrupt mechanism

It is now possible to emit a single part in the middle of a payload production.
This part will be processed with limitation (only access to a `ui` object). The
goal is to let the server raise exception and output while a part is being
processed. The source motivation is to transmit exception that occurs while
generating a part.

This change is was the motivation to bump the bundle2 format from HG2X to HG2Y.
Somehow, the format bump made it into 3.2 without it. So this change go on
stable. It is low risk as bundle2 is still disabled by default.

--HG--
branch : stable
extra : rebase_source : 4df6a216028cfbedc288860e66dca8d0b7e750b1
bundle2: transmit exception during part generation

If an exception is raised during a bundle2 part payload generation it is now
recorded in the bundle. If such exception occurs, we capture it, transmit an
abort exception through the bundle, cleanly close the current part payload and
raise it again. This allow to generate valid bundle even in case of exception so
that the consumer does not wait forever for a dead producer. This also allow to
raise the exception during unbundling at the exact point it happened during
bundling make debugging easier.

--HG--
branch : stable
extra : rebase_source : 69e8f0f70c34d58c28b0ee06d7163b8d05c672d3
eol: fix crash when handling removed files

ci --amend would in some cases fail after 650b5b6e75ed failed to refactor the
eol extension too.

--HG--
branch : stable
extra : rebase_source : c99d1ce29e46518911e7570c181c1423e65c7893
sslutil: only support TLS (BC)

In light of the POODLE[0] attack on SSLv3, let's just drop the ability to
use anything older than TLSv1 entirely.

This only fixes the client side. Another commit will fix the server
side. There are still a few SSLv[23] constants hiding in httpclient,
but I'll fix those separately upstream and import them when we're not
in a code freeze.


0: http://googleonlinesecurity.blogspot.com/2014/10/this-poodle-bites-exploiting-ssl-30.html

--HG--
branch : stable
extra : amend_source : 4dc27cf5015ec25465fcee8cddf2979a028e52cf
hgweb: disable SSLv3 serving (BC)

Because of recent attacks[0] on SSLv3, let's just drop support entirely.

0: http://googleonlinesecurity.blogspot.com/2014/10/this-poodle-bites-exploiting-ssl-30.html

--HG--
branch : stable
amend: fix amending rename commit with diverged topologies (issue4405)

This addresses the bug described in issue4405: when obsolescence markers are
enabled, amending a commit with a file move can lead to the copy information
being lost.

However, the bug is more general and can be reproduced without obsmarkers as
well, as demonstracted by Pierre-Yves and put into the updated test.
Specifically, graph topology divergences between the filelogs and the changelog
can cause copy information to be lost during amends.

--HG--
branch : stable
rebase: improve base revset performance

The old revset had pretty terrible performance on large repositories (12+
seconds). This new revset achieves the same result in only 0.7s. As we improve
the underlying revset APIs we can probably get this revset down to 'only(base,
dest)::', but at the moment that version still takes 2s.

--HG--
branch : stable