Mercurial > hg
comparison tests/test-sparse.t @ 33496:258298f4712b
sparse: override dirstate.walk() instead of dirstate._ignore
Instead of treating files that are outside the sparse config as
ignored, this makes it so we list only those that are within the
sparse config by passing the sparse matcher to dirstate.walk().
Once we add support for narrow (sparseness applied to history, not
just working copy), we will need to do a similar restriction of the
walk over manifests, so this will be more consistent then. It also
simplifies the code a bit.
Note that a side-effect of this change is that files outside the
sparse config used to be listed as ignored, but they will now not be
listed at all. This can be seen in the test case where "hg purge" no
longer has any effect because it doesn't see that the files outside
the space config exist. To fix that, I think we should add an option
to dirstate.walk() to walk outside the sparse config. We might expose
that to the user as --no-sparse flag to e.g. "hg status" and "hg
purge", but that's work for another day.
Differential Revision: https://phab.mercurial-scm.org/D59
author | Martin von Zweigbergk <martinvonz@google.com> |
---|---|
date | Tue, 11 Jul 2017 10:46:35 -0700 |
parents | de324547c751 |
children | 7dcb517122f9 |
comparison
equal
deleted
inserted
replaced
33495:d78b7d734b63 | 33496:258298f4712b |
---|---|
142 show2 | 142 show2 |
143 $ hg st | 143 $ hg st |
144 M show | 144 M show |
145 | 145 |
146 $ hg up -qC . | 146 $ hg up -qC . |
147 TODO: add an option to purge to also purge files outside the sparse config? | |
147 $ hg purge --all --config extensions.purge= | 148 $ hg purge --all --config extensions.purge= |
148 $ ls | 149 $ ls |
149 show | 150 hide |
150 show2 | 151 hide3 |
152 show | |
153 show2 | |
154 For now, manually remove the files | |
155 $ rm hide hide3 | |
151 | 156 |
152 Verify rebase temporarily includes excluded files | 157 Verify rebase temporarily includes excluded files |
153 | 158 |
154 $ hg rebase -d 1 -r 2 --config extensions.rebase= | 159 $ hg rebase -d 1 -r 2 --config extensions.rebase= |
155 rebasing 2:b91df4f39e75 "edit hide" (tip) | 160 rebasing 2:b91df4f39e75 "edit hide" (tip) |