Do not return all files when checking changed files from last commit #7228
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Summary
#6732 improved the commands used to check the files that have checked for both Mercurial and Git repositories, but caused a bug on Mercurial repositories.
Turns out that executing
hg status -A
returns every single file on the repository, which is wrong (and extreeeemely slow for huge repos like FB's one 馃槄).This PR changes the arguments passed to the
hg
command whenlastCommit
istrue
to fix the problem.Test plan
jest-changed-files
does not have any tests (which is understandable since testing its functionality is not straightforward), so I've done some manual testing:hg status -amnu --change . <some_folders>
on a Mercurial repository and check that it always returns the changed files from the current commit.