transaction: fix __repr__() and make the default name bytes
This likely was always wrong on py3, since going back to
aff5996f3043, these
were added as a r-strings. Callers seem to always be supplying bytes, which
makes the `b'/'.join(...)` part OK, but then bytes can't be interpolated into
str with "%s", so it wouldn't have worked in either case.
rhg: support rhg files [FILE]
This comes mostly for free after the rhg status [FILE] implementation.
rhg: support "status FILE"
This change adds a new [file] argument to rhg status, parses them as
patterns, canonicalizes the paths, and constructs a new PatternMatcher
to intersect with the existing matcher being passed to the status
implementation.
We also make filepatterns a public module so we can access the
pattern-parsing functionality we need from commands/status.rs.
rust-matchers: add PatternMatcher
This should match the behavior of the Python patternmatcher. We need
this for status [FILES] support.
rust-status: only visit parts of the tree requested by the matcher
This is an optimization that the matcher is designed to support, but
we weren't doing it until now. This is primarily relevant for
supporting "hg status [FILES]", where this optimization is crucial for
getting good performance (without this optimization, that command will
still scan the entire tree, and just filter it down after the fact).
When this optimization fires we have to return false from
traverse_fs_directory_and_dirstate, representing that that part of the
tree *might* have new files which we didn't see because we skipped
parts of it. This only affects the cached result of the status, and
is necessary to make future status operations (which might use a
different matcher) work properly.
rust-status: error on non-existent files in file_set
file_set here consists of the files that were explicitly specified on
the command line. Erroring on them matches the behavior of Python
status.