Thursday, May 10, 2007

Watch Out for Eclipse and Subversion

If you're using Eclipse and Subversion at the same time, beware. When compiling, Eclipse copies the src directory over the bin directory. Presumably this is perfectly okay for most people. However, if you're using Subversion, this means that it will also copy the .svn directory that is inside src. The upshot is that Subversion now thinks that your bin directory is your src directory: it will think all the source files are missing, and try and update them.

And don't make the mistake that I did, before I discovered the above problem: I svn-deleted the source files from the bin directory, assuming they shouldn't be there (which technically they shouldn't). However, when I then update my src directory, it deleted all the source files from there as well! It did this because when I deleted them from the bin directory, Subversion thought it was the src directory!

I'm now trying Subclipse...


Anonymous said...

Thanks for the heads up! Now I understand what's happening with my source tree. Wasted a lot of time trying to figure this out! Didn't realise Eclipse was copying the _svn directory to the bin dir... this explains everything.

Steve said...

No probs. You'll be glad to hear that once Subclipse is installed, it all works okay. Well, almost; my /bin directory seems to get confused with itself, but that it is easily sorted with a rebuild.