Earlier this week, I opened bug 228701 asking for Mylyn filtering on the Synch view. (Please vote if you agree.) This afternoon in #eclipse-dev, Eugene pinged to ask why I don't simply use the Change Sets presentation in the Synch view, and Boris chimed in to tell me about bug 143419, "Strange tree rendering in synchronize view". Strange indeed.
I agreed I'd document my experiences with this view, but because Bugzilla is undergoing maintenance at the moment (thanks to our tireless webmasters!) and I want to share it while it's fresh, here's my account of how to make files vanish from the Synch view, though Mylyn continues to track them.
DO try this at home, as magic tricks in Eclipse are rare (e4 demo at EclipseCON with spinning views & scriptable UI elements notwithstanding), and this one's pretty cool.
Steps to reproduce
- Install the latest Eclipse 3.4 I build (I've got eclipse-SDK-I20080422-0800-linux-gtk.tar.gz.)
- Install Mylyn from its update site (mylyn-2.3.2-e3.4.zip).
DO NOT unpack it first, just give the URL to Eclipse's new p2 / Install Manager or download the zip and hand it that. If you unpack it first, p2 doesn't seem to know how to find the features therein. But I digress...
- Check out some CVS project into your workspace. I used :ext:firstname.lastname@example.org:/cvsroot/modeling/org.eclipse.emf/org.eclipse.emf.releng, from HEAD.
- Open Mylyn's Task List view (Shift-Alt-Q, Q). Create a new Local Task or open an existing Bugzilla task. Enable the task.
- Unfilter the Package Explorer view.
This is one of my *very* few complaints about Mylyn -- I'm starting a new task w/ no context, yet it insists on filtering my view to show me my non-existent context, so I can't start selecting files on which to work until I unfilter the view. But I digress again...
- Open the Synchronize View (Shift-Alt-Q, Y).
- Configure the view as shown below:
- In the Synchronize view, select the Change Sets presentation (the toolbar icon that looks like a file tree).
- Create a new Synchronization. Type CVS, Resources to synch: Workspace. Hit Finish.
- Open some files in the Package Explorer view, and edit them. Watch as they appear in the Synch view as items under your Change Set (ie., as changes for your Local or Bugzilla Task)
It would be nice if the Change Set title included the bug number, or could be configured the same way that commit comments can be. Not crucial, just a handy enhancement. For now, the task's title is sufficient.
- Pick some file in the CVS-backed project and copy it within the same folder. Notice how it appears in the Synch view as an outgoing addition.
- Here's where the magic trick starts. Made sure your audience is still awake.
- Disable your Task.
- Copy some file (could be the same one as before, or a new one -- doesn't matter as long as it's in a CVS-backed project. The new file will appear in the Synchronize view under a new <Unassigned> Change Set.
- Re-enable your Task.
- In the synch view, select the new file from under the <Unassigned> Change Set.
- As you select the file, it will be added to Mylyn's context for that task, and appear in the filtered Package Explorer. Note however that it didn't change from the <Unassigned> Change Set to your Task's change set. So begins the magic.
- In the Synchronize view, select the Workspace presentation (the toolbar icon that looks like a file tree).
- When you expand the tree, you'll see that your new file does appear as you'd expect. This tree should mirror what's in the Package Explorer (as in previous screenshot).
- Switch back to the Change Sets presentation, and get ready for your exit with flourish.
- Lo, that new file has vanished!