Friday, May 8, 2009

Warning: DO NOT INSTALL Subclipse 1.6 for Eclipse 3.4.x

The Problem
Save yourself a few days of headache ... don't do it! More details to come.

So Mike (mseaton) and I recently upgraded to Eclipse 3.4.2 because of some messed up issues with JSP/XML Validation within Eclipse 3.4. We also both installed Subclipse 1.6 thinking it would bring us joy. Three days later, with lots of back-and-forth collaboration on a project that we have sitting in Subversion, we've experienced nothing but headaches. When he's committed code to the repository, I'll update my working copy only to find that the only changes that come through are ones that are non-conflicting. So when I then try to commit my changes, I get warnings that my working copy is not up-to-date. I think the problem might be the fact that the new "SVN Update to HEAD" feature does not do a --force (but that's just a hunch). I just finished reverting my Eclipse upgrade to Subclipse 1.6 and have successfully reinstalled Subclipse 1.4.7.

Now the issue is that Subclipse 1.6 (which uses Subversion 1.6 wc format) has upgraded all of my working copy metadata to Subversion 1.6. Installing Subclipse 1.4.7 (which uses Subversion 1.4 wc format) means that I cannot use Subclipse on my currently checked out code. Since I have about 30+ projects checked out, this is kind of a problem. I can't waste hours

Here's the error you'll get when

root@jmiranda-laptop:~/Workspace/module-birtreport# svn diff
svn: This client is too old to work with working copy '.'. You need
to get a newer Subversion client, or to downgrade this working copy.
See http://subversion.tigris.org/faq.html#working-copy-format-change
for details.


So thankfully, the subversion folks have a downgrade script:

http://subversion.tigris.org/faq.html#working-copy-format-change


Download the script and run the following command:

root@jmiranda-laptop:~/Workspace# python change-svn-wc-format.py module-birtreport --force --verbose 1.5
Converted WC at 'module-birtreport' into format 9 for Subversion 1.5


Now, at least, I can run svn commands on that directory.

root@jmiranda-laptop:~/Workspace/module-birtreport# svn diff
Index: .project
===================================================================
--- .project (revision 7566)
+++ .project (working copy)
@@ -1,18 +1,18 @@
...

However, when I open Eclipse I can no longer see the very helpful icon overlays on top of files that are "unchanged" or "dirty". I just get unadorned, naked file icons.

Anyone have any ideas on how to fix it?

"Taste my sad, Michael" -G.O.B Bluth

Update:
So the "icon overlay" was looking more and more like an Eclipse issue, so I decided to start Eclipse with the "-clean" option.

/usr/lib/eclipse3.4.2/eclipse -clean


That fixed it. And still a few hours short of what it would have taken to reinstall Eclipse, plugins, and re-download all source code.

"Taste the happy, Michael" -G.O.B Bluth

Update:
It's still broken. Only the top-level folders were successfully restored after the -clean restart. After a few restarts and rebuilds, none of the files or folders have the icon overlay. So we're back to square one.

Following Ben's advice, I tried to install Subversive, but this did not help either. This seems to be a problem with Eclipse. It's as if Eclipse is blocking the icon overlay feature of any plugin (except the core plugins that mark files with "build errors". Checking the properties of any of the files definitely shows that they are "managed" and should have at least the "managed" icon.

One last thing (check the error logs again) and then I'm going to re-install Eclipse.

Last Update:
Ok, so some combination of the above instructions, as well as closing all projects and dealing with them one at a time, while drinking coffee, and threatening to reinstall Eclipse while shaking your fist at your computer, on top of the Celtics winning Game 2 of the Eastern Conference Semifinals has seemed to fix the problem.

I can't explain it folks. Just keep playing around until it works. The one project at a time helped me focus on what I was doing.

(1) Run the script to convert from svn 1.6 to svn 1.5
(2) Clean project
(3) Build project
(4) If that fails to work, close Eclipse and restart with the (-clean) option.

The last thing I was going to try was to create a brand new workspace and move one project over at a time (running the svn convert script). It didn't come to that thankfully.

As I mentioned earlier, the last resort option would have been to reinstall Eclipse and download all of my project source code. Given that half of my day was spent troubleshooting this, I would recommend going that route when you're confronted with this issue and can't get it resolved within an hour.

7 comments:

Ben Wolfe said...

Subversion clean-up ?

Justin Miranda said...

Good idea, but that didn't work. It's not a project specific issue because I checked out a fresh copy from subversion and the overlays aren't working for that project either.

Robby O'Connor said...

Justin, you do realize OpenMRS has a free OSS IDEA license right? Ditch Eclipse and go to a sane IDE :)

Mark Phippard said...

I would guess you were running into this bug in core Subversion:

http://svn.collab.net/viewvc/svn?view=revision&revision=37607

As you see it was just fixed and it was backported to the about to be released 1.6.2.

Justin Miranda said...

Thanks Mark. The issue appeared to be on "svn update". When we pulled down changes, only some of them were getting pulled down. I'll check out the new version when it's released and see if this behavior is still occurring. And we'll create a bug report this time. :)

Mark Phippard said...

Yes, that is when that problem happens. The problem is created when a new folder is Added. It is being added in such a way that the children added by other users will not be brought down on update. You would only get updates on the items you specifically added and not on their children.

You can fix the problem by using the Update to Version ... option and changing the depth to Fully recursive. However, this also has a problem fixed in 1.6.2. Namely, that this option only is changing the item you select, and none of its children. So you have to run it on every folder you added locally in your WC.

The last option is to do a fresh checkout. That fixes everything (at least until you add a new folder).

NONONO said...

I was running into the same problem with the icon overlay not displaying for Subclipse 1.4.8 and the way I got it fixed was to right click on each individual project in my workspace go to "Team > Share Project" chose "SVN" in the window that popped up (as that's what I'm using) and kept the check box to validate connection on finish and clicked finish.

Once this was done the overlay for the icons appeared.