repoview: use set for blockers

Blockers should be unique but tags and bookmarks could point to the same rev,
therefore use a set to ensure that we don't have duplicates.

--HG--
extra : rebase_source : eeafc9cb22a894e4c76ca464f5b5bfd37fd37f05
extra : amend_source : 5a3e3885a5539236fbf8688f94b1d5ee2833b559
repoview: split _gethiddenblockers

Split up _gethiddenblockers into two categories: (1) "static' blockers
that solely rely on the contents of obstore and are visible children of
hidden changsets. (2) "dynamic" blockers, appearing by having wd parents,
bookmarks or tags pointing to hidden changesets.

We assume that (1) doesn't change often and can be easily cached with a good
invalidation strategy. (2) change often, but barely produce blockers, so we
can recompute them if necessary.

--HG--
extra : rebase_source : 2c20fc27f2c8951478c4ffb09cc72c1080d107a3
extra : amend_source : b6ccbfdc5e8612596c5152fb79f17baa228ff66f
repoview: add caching bits

Add a caching infrastructure to cache hidden changesets. The cache tries to read
the cache lazily and falls back to recomputing if no wlock can be obtain.
To validate the cache we store a sha of the obstore content and repo heads in
the beginning of the cache which we check every request.

--HG--
extra : rebase_source : 265e10e196c4d11ce72eaef17d93a1a9f0ab5df3
repoview: cache hidden changesets

Use the introduced caching infrastructure to cache hidden
changesets. We crosscheck if the content of the cache unless
experimental.verifyhiddencache is set to False. This will be removed
in the future. Without crosschecking the caches speed ups hg status and
other commands:

without caching:
$ time hg status
hg status  0.72s user 0.20s system 100% cpu 0.917 total

with caching
$ time hg status
hg status  0.49s user 0.15s system 100% cpu 0.645 total

--HG--
extra : rebase_source : c84dc0e60cfeccc96a6504c6fc26b0e9b31ca911
extra : amend_source : 1aad9165907bd3590b25a8efc8c7330c38c266dc
histedit: add "roll" command to fold commit data and drop message (issue4256)

This new histedit command (short for "rollup") is a variant of "fold" akin to
"hg amend" for working copy: it accumulates changes without interrupting
the user and asking for an updated commit message.

--HG--
extra : rebase_source : 57ab50d48208c71b8af1936c72c2f81f13e97faa
revert: move manifest membership condition outside of the loop

Currently, revset is using information from dirstate status and alter its
behavior whenever the file exist in the target manifest or not. This tests are
done a big for loop. We move this member ship testing outside of the loop and
simplifies associates data structure.

This is a step toward a cleaner implementation of revert based on status.

--HG--
extra : rebase_source : d47736bc16c6a1b21eebf4b95ab4e20d6a2e3562
revert: prefix variable names for dirstate status with "ds"

As we are going to introduce status again other revision we needs to distinguish
between data from dirstate status and the other one. We prefix the existing data
with "ds" to highlight this.

--HG--
extra : rebase_source : 2ce3e68830c0793fe6f9f16a08f19daff25a3f06
revert: call status against revert target too

We now call status against the target (and possibly against the working
directory parent is different). We do not use the information from the two
sources yet, but this is coming soon.

We need the status information aganst the dirstate in all case because we need
to be able to backup local modification.

--HG--
extra : rebase_source : 4be3caa25ac2eedda7f703ee1900b83708244920
revert: issue "no changes needed" message for files missing on both side

When a file was marked as removed in the working copy and did not existed in the
target of the revert, we did not issued any message pointing that no change was
needed to the file (implicitly saying that revert had changed the file).

We now properly issue a message in this situation. Tests change in and handful
of case where the message was documented as missing.

--HG--
extra : rebase_source : 60e5dbe2dd9e436511b481ebe188aee69529b34d
test-alias: add some tests to ensure we aren't double-substituting

An earlier iteration of an upcoming patch caused inadvertent
double substitution. Ensure we have test coverage for this.

--HG--
extra : rebase_source : 373e763406c5ecb8caad72d6f234cf4674a06bd4
alias: expand "$@" as list of parameters quoted individually (BC) (issue4200)

Before this patch, there was no way to pass in all the positional parameters as
separate words down to another command.

(1) $@ (without quotes) would expand to all the parameters separated by a space.
    This would work fine for arguments without spaces, but arguments with spaces
    in them would be split up by POSIX shells into separate words.
(2) '$@' (in single quotes) would expand to all the parameters within a pair of
    single quotes. POSIX shells would then treat the entire list of arguments
    as one word.
(3) "$@" (in double quotes) would expand similarly to (2).

With this patch, we expand "$@" (in double quotes) as all positional
parameters, quoted individually with util.shellquote, and separated by spaces.
Under standard field-splitting conditions, POSIX shells will tokenize each
argument into exactly one word.

This is a backwards-incompatible change, but the old behavior was arguably a
bug: Bourne-derived shells have expanded "$@" as a tokenized list of positional
parameters for a very long time. I could find this behavior specified in IEEE
Std 1003.1-2001, and this probably goes back to much further before that.

--HG--
extra : rebase_source : 6023e5ba119c4248647429bc5976d136d3b2b267
alias: add test for alias command provided by disabled extension

This should complete cases where "badalias" is set.

--HG--
extra : rebase_source : 98965e6ec69911e3cce1d9b04840c43de3e3b66c
alias: keep error message in "badalias" so that help can see it

Upcoming patches will

 - change help_() to get badalias message without executing cmdalias()
 - raise Abort on bad alias

--HG--
extra : rebase_source : 0026ec5ed24c6703c7b0654d734ec23acb91e578
alias: provide "unknowncmd" flag to tell help to look for disabled command

This patch prepares for breaking the call loop: help.help_() -> cmdalias() ->
commands.help_() -> help.help_().

--HG--
extra : rebase_source : 84987611758b7772c5318ecd6e8d0490a9da11ec
help: provide help of bad alias without executing aliascmd()

The output is slightly changed because of minirst formatting.  Previously,
ui.pushbuffer() had no effect because "badalias" message was written to stderr.

"if not unknowncmd" should no longer be needed because there's no call loop.

--HG--
extra : rebase_source : 0a5569f27d576271b6379ecdf6f7e6651a960f50
alias: show one-line hint for command provided by disabled extension

It will be a hint of Abort exception.  "hg help <alias>" provides the detailed
version as before.

--HG--
extra : rebase_source : 2baa2201087c0ef70e8903e9ae60f9477cf68142
alias: exit from bad definition by Abort

--HG--
extra : rebase_source : 9eb68eddca7bbc22d103f2e88a45812a828b9ce9
run-tests: fix some io ordering

backported from default

--HG--
branch : stable
histedit: preserve initial author on fold (issue4296)

When the authorship of the changeset folded in does not match that of
the base changeset, we currently use the configured ui.username
instead. This is especially surprising when the user is not the author
of either of the changesets. In such cases, the resulting authorship
(the user's) is clearly incorrect. Even when the user is folding in a
patch they authored themselves, it's not clear whether they should
take over the authorship. Let's instead keep it simple and always
preserve the base changeset's authorship. This is also how
"git rebase -i" handles folding/squashing.

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