This avoids conflict with the core extension (`hgext/sparse.py`). In
development mode, the `hgext` version takes precedence and people can easily
use the wrong sparse extension.
`sparse.py` is kept for compatibility.
Differential Revision: https://phab.mercurial-scm.org/D1048
Add a --sparse option to `hg diff` which filters the diff to include only files
that are part of the sparse profile.
When files are moved or copied across the sparse profile boundary, they will
show as added or removed (for moves) in the diff. This is the same behaviour
as `hg diff --root`.
Test Plan:
Expand `tests/test-sparse-diff.t`
Differential Revision: https://phab.mercurial-scm.org/D797
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.
Test Plan:
`tests/test-sparse-diff.t`
Differential Revision: https://phab.mercurial-scm.org/D788