Subversion Tools

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.

svnmucc

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/rob
svnmucc
    -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

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

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.

WinMerge

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.

KDiff3

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.

Bash Completion

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:

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.

Firefox TortoiseSVN Menu

This adds the TortoiseSVN menu for repository URL links in Firefox.

SupoSE

This is an SVN repository search engine.

SubversionLogins

This can be used to selectively remove cached Subversion authentication data.

Advertisements

2 Responses to “Subversion Tools”

  1. Rob Says:

    2010-06-15: updated links from Tigris to Apache.

  2. pete Says:

    Wow, I did not know that bash completion is possible on Windows, let alone SVN completion. I’ll have to give it a try.
    I also recommend CommitMonitor and SVN Notifier – very helpful little tools that make life a little bit easier.
    As for WinMerge and K3Diff they are pretty much a must have tools 🙂
    I’ve never heard of SupoSE but I’ll have to check it as I would benefit from a nice search engine – instead of going manually through logs.
    Thanks for sharing the list.

Leave a Reply

Fill in your details below or click an icon to log in:

WordPress.com Logo

You are commenting using your WordPress.com account. Log Out / Change )

Twitter picture

You are commenting using your Twitter account. Log Out / Change )

Facebook photo

You are commenting using your Facebook account. Log Out / Change )

Google+ photo

You are commenting using your Google+ account. Log Out / Change )

Connecting to %s


%d bloggers like this: