progress: stop getting stuck in a nested topic during a long inner step

Convert, for example, has loops like this:
for revision in source_repo:
  progress(revisions)
  for file in revision:
    progresss(file)

Prior to this change, we would start showing the file-level progress
when we encountered a big revision, and then we'd get stuck in showing
file-progress instead of revision progress, often producing many many
instantly-completing progress bars rather than the actually-helpful
top-level revisions bar.
httpclient: import 0d1b0a8bc549 to fix bug involving late-arriving RST after a response

After a day of hunting this defect, I'm now unable to reproduce the
bug without this patch applied. Regardless, this should fix the
problem I was observing with wireshark. Hopefully this fixes any
flakiness in the buildbot from http2.
histedit: add description about basic histedit function to command help

Before this patch, there is no explicit description that histedit
edits changesets between specified ancestor and the parent of the
working directory: users may notice it by error message "REV is not an
ancestor of working directory".

This patch adds description about basic histedit function to command
help of it.

This patch uses term "ancestor" instead of "parent", because it seems
to be more suitable, and almost all (error) messages already use it.
histedit: add description about "histedit --outgoing" to command help

Before this patch, there is no explicit description that argument is
treated as the URL of the destination repository when "--outgoing" is
specified.

This patch adds description about "histedit --outgoing" to command
help of it.
histedit: discard meaningless comment about 'hexlify node'

Refactoring in 26b41a902195 made this comment meaningless. The node
gotten by "discovery.findcommonoutgoing()" is hexlified in "between()"
by "repo.set('%n::%n', old, new)".
revlog: extract 'checkhash' method

Extract method that decides whether nodeid is correct for paricular revision
text and parent nodes. Having this method extracted will allow revlog
subclasses to implement custom way of computing nodes. In particular this
change is necessary to implement manifest compression.
revlog: pass node as an argument of addrevision

This change will allow revlog subclasses that override 'checkhash' method
to use custom strategy of computing nodeids without overriding 'addrevision'
method. In particular this change is necessary to implement manifest
compression.
solaris: test cases can't use grep -a

The -a option to GNU grep isn't available when using Solaris grep.  Replace
the one use of grep -a in the testsuite with some in-line Python that does
the equivalent, and add a check for grep -a in check-code.py.
solaris: sed doesn't recognize a line without a newline
solaris: tests can't use tail -n

Solaris tail doesn't recognize the -n option.  Replace the one use of it
with some inline python code, and add a test case to check-code.py.
bundlerevlog: extract 'baserevision' method

This makes possible to use bundlerevlog class with subclasses of revlog
that override revlog's 'revision' method. In particular this change is necessary
to implement manifest compression, as it allows extension to replace manifest
class and override 'revision' method there.
unionrevlog: extract 'baserevision' and 'baserevdiff' methods

This makes possible to use unionrevlog class with subclasses of revlog that
override revlog's 'revision' and 'revdiff' methods. In particular this change
is necessary to implement manifest compression, as it allows extension to
replace manifest class and override 'revision' amd 'revdiff' methods there.
hgweb: add dynamic search function selection, depending on the query

This allows adding other specific search functions, in addition to current
keyword search.
hgweb: pass arguments which a function depends on explicitly in search

This changes makes clearer which arguments can a function depend on. Now all
the modified functions depend on the 'query' argument only, but future additions
will change it.
hgweb: search() function supports direct pointing to revision

This doesn't change the behavior, as queries directly pointing to revisions
are not delegated to the search() function now.
hgweb: always run search when a query is entered (bc)

This changes the behavior for queries which point at a revision directly,
now the output is consistent to other cases: it results in only this matched
revision shown, not the log starting with it.
A new test checks this behaviour and fails for the old one.
localrepo: get value from the unfiltered caches should check if the attribute existed.

If the attribute existed already, it should be returned by getattr().
Otherwise, it will be evaluated again.
mq: look for modified subrepos when checking for local changes

It was possible to apply, unapply, fold, patches (etc) with modified subrepos,
which resulted in surprising behavior. For example it was easy to apply a patch
with a modified subrepo, and then the refresh it and accidentally end up
including the modified subrepo on the refreshed patch.

A test has been added to verify this new check.


# HG changeset patch
# User Angel Ezquerra <angel.ezquerra@gmail.com>
# Date 1375742979 -7200
#      Tue Aug 06 00:49:39 2013 +0200
# Node ID a5c90acff5e61aae714ba6c9457d766c54b4f124
# Parent  6ac206fb6f27492a98f46bbff090407ee1b1de72
mq: look for modified subrepos when checking for local changes

It was possible to apply, unapply, fold, patches (etc) with modified subrepos,
which resulted in surprising behavior. For example it was easy to apply a patch
with a modified subrepo, and then the refresh it and accidentally end up
including the modified subrepo on the refreshed patch.

A test has been added to verify this new check.
subrepo: make submerge() return the merged substate

This will be useful when reusing submerge() to improve the handling of subrepos
on mq.


# HG changeset patch
# User Angel Ezquerra <angel.ezquerra@gmail.com>
# Date 1377117244 -7200
#      Wed Aug 21 22:34:04 2013 +0200
# Node ID 2defb5453f223c3027eb2f7788fbddd52bbb3352
# Parent  a5c90acff5e61aae714ba6c9457d766c54b4f124
subrepo: make submerge() return the merged substate

This will be useful when reusing submerge() to improve the handling of subrepos
on mq.
mq: update subrepos when applying / unapplying patches that change .hgsubstate

Up until now applying or unapplying a patch that modified .hgsubstate would not
work as expected because it would not update the subrepos according to the
.hgsubstate change. This made it very easy to lose subrepo changes when using
mq.

This revision also changes the test-mq-subrepo test so that on the qpop / qpush
tests. We no longer use the debugsub command to check the state of the subrepos
after the qpop and qpush operations. Instead we directly run the id command on
the subrepos that we want to check. The reason is that using the debugsub
command is misleading because it does not really check the state of the subrepos
on the working directory (it just returns what the change that is specified on a
given revision). Because of this the tests did not detect the problem that this
revision fixes (i.e. that applying a patch did not update the subrepos to the
corresponding revisions).


# HG changeset patch
# User Angel Ezquerra <angel.ezquerra@gmail.com>
# Date 1376350710 -7200
#      Tue Aug 13 01:38:30 2013 +0200
# Node ID 60897e264858cdcd46f89e27a702086f08adca02
# Parent  2defb5453f223c3027eb2f7788fbddd52bbb3352
mq: update subrepos when applying / unapplying patches that change .hgsubstate

Up until now applying or unapplying a patch that modified .hgsubstate would not
work as expected because it would not update the subrepos according to the
.hgsubstate change. This made it very easy to lose subrepo changes when using
mq.

This revision also changes the test-mq-subrepo test so that on the qpop / qpush
tests. We no longer use the debugsub command to check the state of the subrepos
after the qpop and qpush operations. Instead we directly run the id command on
the subrepos that we want to check. The reason is that using the debugsub
command is misleading because it does not really check the state of the subrepos
on the working directory (it just returns what the change that is specified on a
given revision). Because of this the tests did not detect the problem that this
revision fixes (i.e. that applying a patch did not update the subrepos to the
corresponding revisions).