Yesterday’s Thoughts

February 16, 2005

More on Subversion

I completed the move to Subversion for synchronization between my server, desktop and laptop.

I created four Subversion repositories: for my home directory and basic personal files, for code (personal and archive), for training documents, and for work related documents. All four of these are checked out to my server. The work documents are not checked out to my desktop, the code doesn’t go to my laptop and the training documents don’t go to work. I am not sure this is the ultimate mechanism. It might be easier to create only one repository and then control what is checked out to various locations by ignore directives (see below.)

There have been a couple of problems. I am learning Subversion, but the mechanism for ignoring files seems clumsy in comparison to CVS. In CVS, there are .cvsignore files that list patterns to ignore. The is a repository level ignore directives and then directory level .cvsignore files. The mechanism is pretty straight-forward. In Subversion, you add the pattern to the properties of the repository and the directory. I assume these are also stored in the file system, but they may be stored in the repository. In any case I can’t located them to edit easily.

The result of being at the low point on the learning curve is that I am getting files into the repository that aren’t really useful to share between multiple machines (.emacs.desktop, .bash_history) (Maybe I want different branches for the different machines?)

This problem is compounded by problems I am having with TortoiseSVN, the Windows client. Tortoise installs on the Windows Explorer context menu so that it is available when you right click, but I’ll be damned if I can understand the context rules. There is an “Add to Ignore List” command that appears when right clicking on some files or folders. Whether it is folders that are or are not currently under version control I can’t tell. The it seems like there is a low probability of it appearing.

Worse, it doesn’t work. Every time I have been luck enough to encounter the menu, I get the message, “Could not add file to the ignore list!” (The exclamation point is inside the quotes on purpose.)

I have also had a couple of problems with not being able to do anything because files are lock, or cannot be renamed for mysterious reasons which cause Tortoise to tell me to “Please execute the ‘Cleanup’ command.” Then the Cleanup command fails.

To be fair, I haven’t read the Tortoise documentation so perhaps I am doing something fundamentally wrong.

If you are following this shaggy dog story carefully, you will realize that I am having to do this synchronization by hand. This is a large drawback, and also a drawback because I have four repositories, so I have go navigate into each relevant directory (the root of the corresponding tree) to perform the synchronization. This can eventually be handled with scripting.

Otherwise, this system deals well with my seven objections to Windows synchronization.

1) The synchronization is fast and it happens on my schedule.

2) The response times are fast and uniform. All operations are working on files on my local disk.

3) This mechanism should work for all applications.

4) The issues of different config files on different boxes should be resolvable.

5) There are no problems with Windows synchronization.

6) I haven’t tested it yet, but I should be able to move a file or a folder on one box and have it migrate on the others.

7) There is a central storage point, so I can back it up regularly.

I haven’t tried this with my Music files yet; the next thing to do is to move all my web server files into the repositories.

The other drawback is that committing a check in requires a comment. This will save my butt many times in the future I am sure, but there are times it is more of a bother.

[Update 2005-02-17] I have added a link to TortoiseSVN. Having read the documentation, I see that I can add an ignore on a per directory basis through the directories properties. This simplifies things for me, but I don’t understand the context menu command not working. Perhaps I am still missing something. This seems easier to make happen using the command line.

The other property that I came across is the svn:external which allows you to have a single directory that comes for a separate svn repository. This will come in handy for my multiple repositories.

Example using bash:
stork$ svn propset svn:externals 'Training http://fq.d.n/Training > Work http://fq.d.n/svn/Work > code http://fq.d.n/svn/code' .
The newlines separate the properties, so they are required.
I cribbed this example from here. The use of propset in Subversion is poorly documented in general; most of the examples show the results of setting the properties via svn propget, but that is not necessarily helpful.

With this in place, I can do a single svn up or svn status and see the status of the whole tree. For commits and adds, I have to move into the subdirectory, which seems like a good thing, although perhaps this should be configurable.

Also, according to this page the support for this mechanism is not necessarily permanent.

Interestingly, the subversion developers consider externals a horrible hack which is likely to go away post-1.0. Fortunately, they also claim it will be replaced with a yet-unspecified “something better”.

I like this particular horrible hack for my purposes. It is useful for synchronization to have multiple data sources and to have them interoperate.

Sorry, comments for this entry are closed at this time.