manifestdict: extract condition for _intersectfiles() and use for walk()
The condition on which manifestdict.matches() and manifestdict.walk()
take the fast path of iterating over files instead of the manifest, is
slightly different. Specifically, walk() does not take the fast path
for exact matchers and it does not avoid taking the fast path when
there are more than 100 files. Let's extract the condition so we don't
have to maintain it in two places and so walk() can gain these two
missing pieces of the condition (although there seems to be no current
caller of walk() with an exact matcher).
manifestdict.walk: remove now-redundant check for match.files()
When checking whether we can take the fast path of iterating over
matcher files instead of manifest files, we check whether
match.files() is non-empty. However, now that return early for
match.always(), it can only be empty when there are only
include/exclude patterns, but in that case anypats() will be True, so
it's already covered. This makes manifestdict.walk() more similar to
manifestdict.matches().
manifest.walk: special-case match.always() for speed
This cuts down the run time of
hg files -r . > /dev/null
from ~0.850s to ~0.780s on the Firefox repo. Note that
manifest.matches() already has the corresponding optimization.
manifest.walk: use return instead of StopIteration in generator
Using "return" within a generator is supposedly more Pythonic than
raising StopIteration.
archive: look for first visible revision to build repo identity (
issue4591)
No test for the case where all revisions are hidden because "archive" command
aborts if the target revision is null.
largefiles: use common function to build content of .hg_archival.txt
This fixes the missing "changessincelatesttag" field introduced by
242d11819c6c.
archive: extract metadata() closure to module-level function
This function will be reused in largefiles.
templatekw: have {manifest} use ctx.manifestnode() for consistency
changeset_printer was updated at
f57640bf10d4 to not access changeset by
index.