It's been a somewhat common request among our users to have Mercurial
automatically pick includes to remove. This patch adds an option for
that: hg tracked --auto-remove-includes. I'm not sure if this is the
right name and semantics for it. Perhaps the feature should also add
excludes of large subdirectories even if other files in the include
are needed? Narrow clones are experimental, so we can change the name
and/or semantics later if necessary.
Details
- Reviewers
durin42 pulkit - Group Reviewers
hg-reviewers - Commits
- rHG40f78072fda9: narrow: add option for automatically removing unused includes
Diff Detail
- Repository
- rHG Mercurial
- Lint
Automatic diff as part of commit; lint not applicable. - Unit
Automatic diff as part of commit; unit tests not applicable.
Event Timeline
tests/test-narrow.t | ||
---|---|---|
457 | This obsolete commit is completely lost afterwards, which kind of violates the principle of "all changes are kept forever" - should it dump this somewhere for safekeeping? |
tests/test-narrow.t | ||
---|---|---|
457 |
Yes, it does dump it to a backup bundle (see output on line 474).
That's just about the working directory, right? This file is unchanged in the working directory at the time of hg tracked --auto-remove-includes... |
tests/test-narrow.t | ||
---|---|---|
457 |
No, I meant what if you don't get rid of the .i files. Alternatively, or in addition, maybe a confirmation prompt pointing out which commits and narrowspec entries will be dropped may be useful. |
tests/test-narrow.t | ||
---|---|---|
457 |
This is not changing which .i files we get rid of; the behavior should be the same as if you had typed hg tracked --removeinclude path:d0 --removeinclude path:d2.
Yes, it should be, but it doesn't print those files if they were clean. I've added a call to hg files to the test so you can see that they are cleaned up.
I considered that but I wasn't sure if it would be more annoying than helpful. Want me to add that? |
tests/test-narrow.t | ||
---|---|---|
457 | I added that prompt. We also talked about adding a --dry-run option instead of the prompt, but that seemed harder because it would need to be handled in many different cases, including --update-working-copy, even if we just decide to error out. |
hgext/narrow/narrowcommands.py | ||
---|---|---|
332 | Can you add some help text below on how these unused includes are calculated? |
hgext/narrow/narrowcommands.py | ||
---|---|---|
332 | Even though it's marked EXPERIMENTAL? Or maybe I should do that and just drop the EXPERIMENTAL since the whole feature (narrow clones) is experimental anyway? |
hgext/narrow/narrowcommands.py | ||
---|---|---|
331 | I was also wondering about that. Maybe those should be changed instead? I'm not sure, but I think we're slowly transitioning option names to use hyphens just like we do with config names? I don't care much, so let me know if you'd still prefer to drop the second hyphen. | |
332 | I decided to drop EXPERIMENTAL. |
hgext/narrow/narrowcommands.py | ||
---|---|---|
369 | sorry, but currently visible commits sounds like not correct as this can be used in case of non-ellipses repository also. |
hgext/narrow/narrowcommands.py | ||
---|---|---|
369 | Good point. I've updated this a bit. See how this sounds. |
Following pattern of other flags, auto-removeinclude(s) seems better.