Subversion (SVN) is an excellent source control system. It is not perfect, but it is extremely well thought out and lightweight.
There are numerous SVN clients and SVN tools out there to complement that functionality.
Supplied with the SVN command line client is svnmucc, the SVN “multiple URL command client”. There’s no documentation for this tool yet; I gather that the documentation team is planning to add a section to the book.
The idea behind svnmucc, which is quite a low-level tool, is that you can operate on more than one URL in a single commit. Use with care!
Here, for example, is the command line to create a new project node with the usual set of subdirectories:
svnmucc -m"Created empty directories for project 1" -U http://repos/ mkdir trunk/project1 mkdir tags/project1 mkdir branches/project1
Note that this should all be on one line, but I’ve split it over several lines for easier reading.
or if you prefer things the other way around:
svnmucc -m"Created empty directories" -U http://repos/ mkdir project1 mkdir project1/trunk mkdir project1/tags mkdir project1/branches
Note again that this should all be on one line.
Here’s another example, creating related branches in more than one project (in two steps):
svnmucc -m "Created empty directories for engineer-specific feature-development work or 'shelving'" -U http://repos/ mkdir branches/project1/dev mkdir branches/project1/dev/rob mkdir branches/project2/dev mkdir branches/project2/dev/rob mkdir branches/project3/dev mkdir branches/project3/dev/robsvnmucc -m "Created branches to hold the feature 1 changes" -U http://repos/ cp 1000 trunk/project1 branches/feature1/project1 cp 2345 trunk/project2 branches/feature1/project2 cp 1234 trunk/project3 branches/feature1/project3
Note that each of these should all be on one line.
The second of these two commands is particularly significant as it ties together in the history the various sets of changes.
The two commands could have been combined into a single command, had I wished to to so.
Note that as this tool is a low level tool, every individual URL to be operated upon must be given explicitly. This tool would be difficult to use to commit many added files for example.
If you use this on Micro$oft Windoze, then the following are also available:
CommitMonitor may be set up to watch for commits to one or more URLs in one or more repositories. The program sits in the system tray, and will “wiggle its eyes” at you when it notices a new commit.
SVN Notifier may be set up to watch for remote commits associated with (perhaps many) working copies.
This is very useful to help keep your working copies up to date (and updated).
CommitMonitor and SVN Notifier work in different ways, and it’s entirely possible to use both in tandem.
CommitMonitor may be used without having a working copy; it watches (possibly many) repository URLs in isolation.
SVN Notifier is better for working with working copies, as it compares each working copy with what is in the repository. It may be and must be set up for each working copy of the same repository URL.
If you don’t like the TortoiseSVN difference viewer, differences (2-way) may be shown using WinMerge. The WinMerge installer has an option to intergrate itself into Tortoise for you.
On those occasions where you need to view a 3-way difference (for example, when there’s a merge or update conflict), KDiff3 is a reasonable tool for doing this, if you prefer a GUI to manual edit in a programmers’ editor.
If you use Cygwin or Linux, and you use the SVN command-line client in a Bash shell, then you might find it useful to extend Bash Completion for SVN commands.
When you press the TAB key when using Bash, Bash will help you to complete a path, or an option/switch name. Likewise, Bash can be set up to complete SVN sub-commands and option, and also URLs (repository paths).
Unfortunately, I’ve never managed to get this working as well as I’d like.
There are many examples and articles on the subject on the web:
- bash_completion file in the SVN repository
- bash_completion_svn file with URL support from silverorange labs
On the other hand, finding out how to get this working at all in Cygwin is quite a problem.
The first thing you need to do is run the Cygwin setup program and install “bash-completion”, which may be found listed under “shells”. Then find your profile directory (probably under <C:\Documents and Settings\username\>). Copy the bash completion file to that directory, and also create or edit the <.bashrc> file there with the following section:
if [ -r /etc/bash_completion ]; then . /etc/bash_completion fi
If you know of a particularly good example of this, please let me know. The SVN version of this does not currently support the completion of URLs; the silverorage version may not be up to date.
This adds the TortoiseSVN menu for repository URL links in Firefox.
This is an SVN repository search engine.
This can be used to selectively remove cached Subversion authentication data.