revert: evaluate filesets against working directory (
issue4497)
As the failing revert tests in test-fileset-generated.t show,
Revert currently creates one matcher for matching files in the working
copy and another matcher for matching files in the target
revision. The two matchers are created with different contexts, which
means filesets are evaluated differently. Then the union of the sets
of files matching the matchers in the two contexts are reverted. It
doesn't seem to make sense to use two different matchers; only the
context they're applied to should be different.
It seems very likely that the user wants the filesets to be evaluated
against the working directory, which the tests
test-fileset-generated.t also assume, so let's make it so.
I willingly admit that the largefiles code was modified by trial and
error (according to tests).
largefiles: override cmdutil.revert() instead of comands.revert()
By overriding the cmdutil method we don't need to override both the
function and the command. Also, we get access to the 'ctx' and
'parents' variables, which will soon prove useful.
Rename the 'ctx' argument to overridematch() to 'mctx' rather than
letting it shadow new 'ctx'.
test-commit-interactive-curses: backout
852801178a63
Now that the imports have been fixed up, and the platform EOL difference
eliminated, this test runs on Windows.
test-interactive: use stable EOL in various file generating routines
The seq.py and shell echo redirected to a file ends up with platform
specific EOL, which throws off the hash when the file is committed to
the test repo on Windows. The other option is to glob the hashes, but
the ability to see if they have changed might point out problems that
would otherwise be missed.
patch.diff: restrict matcher to relative root in certain cases
Previously we'd request all results, then filter by relative root. This is
clearly inefficient, so we now restrict the matcher to the relative root for
certain easy cases.
The particular case here is when the matcher matches all files. In that case we
can simply create a matcher by the relative root.
This is purely an optimization and has no impact on correctness.