When commands like 'diff' request the contents of files from a workingfilectx,
normally this is satisfied by reading from disk. For files outside the sparse
checkout this doesn't work, so instead we must return the content from the
working copy parent.
Details
- Reviewers
ryanmce durham - Group Reviewers
Restricted Project - Commits
- rFBHGX0654bba9a9cf: sparse: get data for excluded files from working copy parent
tests/test-sparse-diff.t
Diff Detail
- Repository
- rFBHGX Facebook Mercurial Extensions
- Lint
Automatic diff as part of commit; lint not applicable. - Unit
Automatic diff as part of commit; unit tests not applicable.
Event Timeline
The change looks good to me. It would be informative to comment on the test what the error was before this change.
I think it might be worth some follow-ups for the weird edge cases we talked about: a sparse-excluded filename being in the working copy -- should we warn in this case? Diff against it with a warning? Diff against the "real" one with a warning?
However, this is clearly better than what we have now and we should get it in, and perhaps into the upstream sparse as well.
Files in the working copy that alias sparse-excluded files are completely ignored by other commands (for example, they don't even show up in hg status), so I think ignoring here is fine, too.
I'm about to push a change that refactors this in preparation for my next diff. This is just to clean it up a bit.
Hmm, seems a bit odd for the wctx to kinda lie about the data in the working copy. But the diff behavior is clearly better than it was before. Guess we'll see.