Subtle Subversion Problem

Here’s a problem you don’t see everyday which really shows up the stupidity of the whole case sensitive / insensitive filesystem battle between Windows and Unix like operating systems. Fortunately a lot of work has been done to make the two different schools of thought play together nicely but occasionally something falls through the cracks and the differences come back to bite you, this is one such situation.

The other day I added a new class to a package, the class was supposed to be called “Plot” but I must have accidentally entered the name “plot” with a lower case first letter. NetBeans created the class in a file called “plot.java”. I noticed the mistake straight away and did a refactoring to call the class “Plot” but NetBeans must have left the file name unchanged because “plot.java” got committed to the source code repository. Somewhere along the lines the name of the file on my development system has been updated to  “Plot.java” and this got committed to the repository as a different file.

My development environment is Windows based so “plot.java” and “Plot.java” are the same file. My Subversion repository, on the other hand, is Linux based so those two files are different. What I think happened was when I committed the “Plot.java” file I hadn’t changed the name of the file as expected with the refactoring and I committed a completely new file. I assume the Subversion client on the Window machine couldn’t tell the difference but the two files were different to the repository.

Anyway, checking out on Windows results in just “Plot.java” and everything builds fine. Checking out on Linux results in both “plot.java” and “Plot.java” which was causing a build failure on my Hudson CI server. The easiest way to solve this problem (for me) is to SSH on the SVN server and issue a quick svn delete such as:

svn delete http://...blah blah.../plot.java -m "some message"