random memes }

Subversion, CVS, and tags

In the process of converting a group of programmers to Subversion, I ran across a surprisingly awkward bit.

As a regular practice, before generating a build to go to customers, I always carefully review all the changes to the program sources since the last customer release. Using CVS the command line is simple (run from the root directory for the component):

cvs diff -t WIDGET_v301

Reviewing the differences helps both to write up a customer-oriented list of changes, and also helps insure that nothing unintended (say, left over experiments or debug code) makes it into the customer release.

With Subversion under Eclipse the equivalent comparison is easy - just select the trunk and tags/v301 and a compare gets the same result as CVS.

With Subversion on the command line, the equivalent comparison is ridiculously tedious.

svn diff http://hostname/path/widget/tags/v301

Um, hello? Subversion knows the http://hostname/path/ part. If I followed the conventional layout, Subversion can deduce that the current directory is trunk and from that the path to tags. Yes, I know the repository layout (in terms of branches and tags) under Subversion can be arbitrary (and this is all very cool), but optimizing for the most-common case is always good.

Figuring that I must have missed something, I went digging, and came up with this gem:

Branko Äibej - Re: svn diff branch woprking copy against mainline? This seems to be a common misconception. The important thing to remember here is that there is no separate namespace for labels and branches in SVN, and that the layout of the repository is arbitrary. IOW, the fact that you have branches in /branches is a convention, not something imposed by the SVN server.

The writer is almost exactly wrong. There are a separate namespaces in the Subversion repository. The namespaces are established by convention. The recommended PROJECT/{trunk,tags,branches} can be recognized by default, and any local variant specified by user-set properties in Subversion. This is easy.

I expected Subversion to be a nearly uniform improvement over CVS, not stuck for years on how to cover simple usage.