Add "Cleanup workspace" command in Items view and Shell extension.
For us, a common operation is that we have run compilation etc in a workspace and then want to wipe out all the generated output files to get a clean workspace again (similar to "make clean" in a Makefile).
This is a feature I miss from TortoiseSVN, which has a context command "Clean up". What that command does is to bring up a small dialog with cleanup-options, where I can choose things like these (translated to Plastic nomenclature):
Refresh shell overlay icons
Delete private items
Delete ignored items
Undo all changes
Apply cleanup to xlinks as well
Perhaps you can think up more cleaning tasks, but for me "Delete private and ignored" is the most important part. Currently, I have to make a tedious workaround like this, in the Items view:
- Right-click the workspace root (only possible in "Tree view" mode).
- Choose "Search - Private items".
- In the new "Private objects" tab, enable the "Show ignored items" checkbox.
- Wait while "Downloading data from repository server..."
- Select all the items in the list (Ctrl+A).
- Delete, "Are you sure?", Yes.
- Wait while "Deleting objects..."
- NOTE: In our workflow we setup some symbolic links inside the workspace to other folders inside the workspace. If I don't delete these symlinks before doing this operation, it will fail when trying to delete the symlinked items!
- Close the "Private objects" view.
- Go to the Pending Changes view.
- Click Options, then uncheck "Show ignored objects". (This part is due to unfortunate linking between this checkbox and the similar "Show ignored items" checkbox in the "Private objects" view. Please fix that as well...)
Not a bad idea, but can be already done from “pending changes”
Göran Wallgren commented
Well, your suggestion is a bit quicker than the way I described, but still involves opening the Options dialog twice to check / uncheck the "Show ignored items" option. Not convenient! Counting mouse clicks, it needs at least 7 clicks and a Ctrl+A.
Instead, I'd suggest a button or context menu choice in the Items view and/or an extra command when expanding the "Undo changes" button (next to "Undo unchanged").
As you seem reluctant to provide an implementation, do you mind if I share here the C# code I wrote as a workaround to be able to script this?
In the end I would you to implement this command in GUI and CLI. It's not really an overlapping feature if it can be done in a single convenient command instead of several steps. The fact that people request it and that other SCMs have a command for it should be hint enough...
You can actually clean up all privates (not ignored) from the pending changes view. No need to do this "search - private items" thing you're doing.
Basically, you can do everything from the "pending changes":
* Just open up pending changes, refresh and undo all changes.
* Then, show ignored (mark the option), and delete all privates.
I don't really think we need to add another feature for that. You know, not a bad idea, but we do really need to avoid adding too many overlapping features.
Göran Wallgren commented
Regarding (private / ignored) symlinks, the "correct" way to delete them is to delete the actual symlinks, not the linked contents "inside" them... At least there should be an option for this!