The sparse checkout extension had a pretty bad flaw where rebasing across
certain no-op file changes would fail the rebase. This was due to Mercurial
adding a 'keep' action on those files and that action getting translated to a
'remove' by the sparse extension, then failing to edit the dirstate during the rebase
branchmerge.
The fix is to only issue 'remove' actions if we're not in a branchmerge
and the file in question is in the workingcopy but shouldn't be.
I also added more validation for the branchmerge scenario to make sure we aren't
losing any dirstate data. It will basically abort if any action besides 'keep'
is performed on a file outside the sparse checkout.
Upstream Mercurial has changed the return value of merge.calculateupdates in two
ways: 1) actions is now a file->action mapping instead of a
actiontype->list-of-files mapping, 2) it now returns actions, diverge,
renamedelete where the last two are just used for displaying to the user and can
be pretty much ignored by the sparse extension.
Summary:
strip -r . -k rebuilds the dirstate and was inserting filtered entries
into the dirstate. This fixes rebuild to exclude sparse files.
Test Plan: Added a test
Reviewers: sid0, pyd, davidsp, mitrandir, rmcelroy
Differential Revision: https://phabricator.fb.com/D1743331
Summary:
Adds a sparse checkout extension that allows you to checkout just part of the
working copy. This only affects the working copy, it does not affect history,
or what is pushed and pulled from the server.
The basic api is:
hg sparse --include PATTERN... # add a pattern to the sparse checkout
hg sparse --exclude PATTERN... # excludes files from the sparse checkout
hg sparse --delete PATTERN... # deletes an include/exclude rule
hg sparse --enable-profile # enables a predefined sparse profile
hg sparse --disable-profile # disables a predefined sparse profile
hg sparse --reset # makes the repository full again
hg sparse --refresh # refreshes the working copy if .hg/sparse was
modified manually
hg sparse # show the current sparse rules
Test Plan:
Added tests. Ran them. Also deploy it to a couple users for a bit
without major issues.
Reviewers: pyd, sid0, rmcelroy, davidsp, mpm
Subscribers: mitrandir, akushner
Differential Revision: https://phabricator.fb.com/D1698824