This can’t be right

Is there anybody out here who knows anything about Subversion? I’m very new to it, and I think I might be used to better revision management systems like ClearCase and Git. Here’s the situation: My boss asked me to fix this project so that it could be built with Maven instead of Ant. One of the important things I had to do to was to move src/com to src/main/java/com, and move test/com to src/test/java/com, which I did using the “svn mv” command. I foolishly assumed that since I used Subversion commands to move the directories, that Subversion would then know that things had been moved. And when I merged my branch into the trunk, it appeared to work. But now somebody else just finished work on a branch that he branched off before my work. So we go to merge his stuff into trunk, and basically Subversion appears to think “ok, he made changes to src/com/foo/bar/baz.java, but that directory doesn’t exist any more, so it’s irrelevant, so discard it” instead of what I expected, which was “ok, he made changes to src/com/foo/bar/baz.java, but src/com has been moved, so I need to merge that into src/main/java/com/foo/bar/baz.java”.

Is there a way to make Subversion do the revision management, or am I going to be manually merging this guy’s changes for the next two days?

5 thoughts on “This can’t be right”

  1. Whoa, whoa, i’m no SVN fan, but to claim that ClearCase is better, well, that’s just crazy.

    Wish i could help you with that, though. After enjoying Perforce, using Subversion was quite obnoxious.

  2. You, and everybody else I know, scoffs at ClearCase, but at least it could handle this case without any human intervention. I used ClearCase for 10 years at Kodak, and it was great. And then they fired our full time ClearCase administrator, and the system started to slowly fall apart.

  3. I’m not a Subversion expert, but I think you will have to fix things up manually. Svn’s support for merging is little better than CVS’s, so I wouldn’t be surprised if changing the directory structure totally hoses things.

  4. I think you are going to be manually merging the guy’s changes for the next two days.

    Yabbut, merging only operates on the same file and there are two files now: the old renamed file (which no longer exists) and the renamed file (which is not in the same location as the changed old file). SVN doesn’t know the two are related.

    Hey, at least SVN has a command to move directories/files with their histories, unlike CVS.

    Your cow orker should copy his changed files in the moved directory somewhere safe, do an update, copy the changed files on top of the newly moved files and hope that you don’t have any overlapping changes.

    SVN sucks much less than CVS but I always found ClearCase to actively encourage stupidity. With SVN or CVS you have to work at stupidity, unfortunately, you have to work at cleverness with them too.

  5. I’m pretty sure that git would detect the move and do the right thing, although I haven’t tested it. It doesn’t even have a move command, and the one brief time I used it, it seemed to detect file moves pretty well.

Comments are closed.