cmdserver: correct doc of channeledoutput

in_ is only used as the source of file attributes.

--HG--
extra : rebase_source : 0c2d00d8f81c45ad69cfdadfb1c2cba93b29a753
cmdserver: get file attributes of 'e'-channel from stdout, not from stderr

It seems wrong to get attributes from object different than the underlying
file.  In the following example, it doesn't make sense to flush stderr after
writing to stdout:

    self.ferr.write(str(a))
    if not getattr(self.ferr, 'closed', False):
        self.ferr.flush()

--HG--
extra : rebase_source : 61af34d96191ac6173c032478b7ab984b96696e8
cmdserver: drop useless in_ attribute from channeledoutput

The previous patch makes sure that in_ == out, so it's no longer needed
to keep in_ for __getattr__.  Also, it seems strange for channeledoutput
to have in_ stream which is actually a writable file object.

--HG--
extra : rebase_source : 420370cd5af314b60f18c8d66516cbe485188ff9
heredoctest: use the same dict for local/global contexts as in doctest

In order to mimic module-level evaluation, globals and locals should be the
same object, so doctest does not pass separate locals dict.

https://docs.python.org/2.7/reference/simple_stmts.html#exec

This fixes NameError in the following example:

    >>> import foo
    >>> def bar():
    ...     foo  # must exist in globalvars

--HG--
extra : rebase_source : 941c74a635fcea5eba321917794bd72521823da7
heredoctest: do not append extra newline character to continuation line

Trailing newline characters are kept in lines.

--HG--
extra : rebase_source : 28be8da997d469f603e7727e0077ee49a68182ce
test-commandserver: split helper functions to new hgclient module

This prepares for porting test-commandserver.py to .t test.

Though command-server test needs many Python codes, .t test will be more
readable than .py test thanks to inlined output.

--HG--
extra : rebase_source : 0bf2fc245682c0488977aae1bbdd0667a085dd7c
test-commandserver: add stub for .t test by copying .out with 2-space indent

Currently test-commandserver.t only contains output, so it is skipped by
#require false.

--HG--
extra : rebase_source : a0a39255f5d6fba81d33769d2e348e829c0b3e6f
test-commandserver: port test functions from .py to .t

Though we have to duplicate import statements, .t test is still more handy
than .py test which has cryptic .out file.

This change allows to skip a part of test by #if conditional, which my next
patch series depends on.

--HG--
extra : rebase_source : 6171827520a9df3195e01e59bf8e3c36745ad015
test-commandserver: remove .py test which was ported to .t

--HG--
extra : rebase_source : c568c916b92f71ee9dc62fbc69172c5118f5f790
test-commandserver: remove redundant banner output

Since test output was inlined, "testing <func>" message should no longer
be necessary.

--HG--
extra : rebase_source : 7c52c30cd14fce59ca5fc07ec730d221db343415
test-commandserver: rewrite manual substitution of output by (glob) match

--HG--
extra : rebase_source : 9a6f0e504623a540e6f8506c07c8cf4d1ee0fbc2
test-commandserver: make runcommand message bolder

It seems ' runcommand' is difficult to distinguish from command output.
'*** runcommand' is slightly better.

--HG--
extra : rebase_source : 0553654211d5781a8e57690ecd2bf9401a426430
revert: special case 'hg revert --all'

On large repos, hg revert --all can take over 13 seconds. This is mainly due to
it walking the tree three times: once to find the list of files in the
dirstate, once to find the list of files in the target, and once to compute the
status from the dirstate to the target.

This optimizes the hg revert --all case to only require the final status. This
speeds it up to 1.3 seconds or so (with hgwatchman enabled).

Further optimizations could be done for the -r NODE and pattern cases, but they
are significantly more complex.

--HG--
extra : rebase_source : 9c8eeecd935ccbf9a138d2b923c9be6b2438f150
ssl: refactor sslkwargs - move things around a bit, preparing for next change

--HG--
extra : rebase_source : b69ff06eeffc2e5490c5ff7755456cb92e4568a0
ssl: on OS X, use a dummy cert to trick Python/OpenSSL to use system CA certs

This will give PKI-secure behaviour out of the box, without any configuration.

Setting web.cacerts to any value or empty will disable this trick.

This dummy cert trick only works on OS X 10.6+, but 10.5 had Python 2.5 which
didn't have certificate validation at all.

--HG--
extra : rebase_source : 3ccf9a9d3a6650914311d0e2b9b44a449614b5d5
help: fix typo in log examples

--HG--
branch : stable
hgweb: refresh hgweb.repo on phase change (issue4061)

Make hgweb.refresh() also look at phaseroots file (in addition to 00changelog.i
file) and reload the repo when os.stat returns different mtime or size than
cached, signifying the file was modified.

This way if user changes phase of a changeset (secret <-> draft), there's no
need to restart hg serve to see the change.

--HG--
branch : stable
extra : rebase_source : d166907c13f2599e05cab6e19b84e58a819ba657
merge with stable