Add sorted() in places found by testing with PYTHONHASHSEED=random and code
inspection.
An alternative to sprinkling sorted() all over would be to change substate to a
custom dict with sorted iterators...
When running:
$ hg debugfileset 'binary() and ignored()'
getfileset() was correctly retrieving ignored files but
matchctx.existing() was not taking them in account. Just add them along
with unknown files.
By default, unknown files are ignored. If the 'unknown()' predicate
appears in the syntax tree, then they are taken in account.
Unfortunately, matchctx.existing() was filtering against non-deleted
context files, which does not include unknown files. So:
$ hg debugfileset 'binary() and unknown()'
would not return existing binary unknown files.
Running:
$ hg debugfileset 'binary()'
would traceback if there were one deleted file in the working directory.
It happened because matchctx.existing() was filtering files against the
ctx.__contains__() but deleted files are still considered part of
workingctx.
This new fileset symbol returns a list of subrepos whose paths match a given
pattern. If the argument has no pattern type set, an exact
match is performed.
If no argument is passed, return a list of all subrepos.
- the power of 2 ones should be kiB, MiB, etc.
- the power of 10 ones (SI standard) should be kB, MB, but we're currently
using the industry traditional units elsewhere
We only call status if needed to avoid walking the working directory
or comparing manifests.
Similarly, we scan for whether unknown or ignored files are mentioned
so we can include them.
This forcibly walks the tree looking for unknown and ignored files,
which is suboptimal. A better approach would scan the tree first to
find required status components and skip the status check entirely if
it's unused.