Thursday, November 15, 2007

Eclipse and Subversion (Subclipse)

I've blogged before about using Subversion and Eclipse - if you haven't installed Subclipse then don't do it! However, I've discovered another problem and solution to Subclipse...

Even when Subclipse is installed, if you have seperate src and bin directories, the bin directory can confuse Subclipse, since Eclipse likes to effectively delete it and recreate it with each build. The solution to this (apart from adding the bin directory to your ignore list) is to not "Scrub output Folder when cleaning projects".

3 comments:

Paul said...

Have you tried subversive? I'm using that one for jcrpg. Mostly works good, except when I tried to move a directory it somehow got totally confused on it.

Mark Phippard said...

What type of project is this? Having Subclipse installed typically fixes the problem you described. If you do not have Subclipse installed, then Eclipse does not know that the .svn folders are for Subversion and will copy them to the bin folder. This does not confuse Subclipse, it confuses Subversion. Subclipse is a UI for Subversion it shows what Subversion tells us and uses only Subversion API call for everything it does.

When Subclipse is installed in Eclipse, we set a flag on .svn folders that tells Eclipse they are private for team providers. Proper Eclipse builders are then supposed to honor this flag and not copy them. That gets back to my original question. You might have a builder on your project that does not respect this flag.

Steve said...

Paul: I might give it a go, but I think I've got Subclipse working okay now.

Mark: Yes, I've got Subclipse installed. To give you some background, it's a one-man project (i.e. only me). I alternate between using Subclipse and TSVN, and (to make it even more complicated) the respository is on a Linux box. The main problem occurs when selecting Project->Clean. After that, if I try to commit, TSVN says the /bin subdirectories are obstructed. Every tip I've seen recommends adding the bin directory to the ignore list. Any suggestions?