3
votes

I have a Subversion repository on a BSD box using svnserve and I'm accessing it with a BSD client via:

svn co svn://my.domain.com/my/repo/dirs ...

which is fine, but I always access using the same domain and I often have to checkout several different directories and retyping the domain is a pain. The svnserve binary is invoked as a daemon and with a specified root directory:

svnserve -d -r /svn/root

I'd like to to configure my subversion client so I can type something like:

svn co dir1/ dir2/subdir dir2/subdir2/

to check in, check out and whatever else since the domain never changes. It would also be nice to have a default directory to check out the files to. I've looked in the book but haven't found anything. I could do this via the shell but it seems like a facility that Subversion might have.

Did I not read the book well enough or is it not possible?

2

2 Answers

2
votes

I have been looking at this for a while now, waiting for a good answer. Unfortunately nobody had any. (Have you tried on superuser.com?)

Anyway, one idea that occurred to me last night is that you could use environment variables. That would turn

svn co svn://my.domain.com/my/repo/prj1

into

svn co $MY_REPO/prj1
1
votes

Subversion URLs can be long simply because the name of the system is long and the directory structure can be long. The Subversion command line client provides few services besides what is absolutely necessary. Unlike other version control systems, like CVS, Subversion was written to allow a customized client. The people who wrote Subversion have stated many times they rather not add features to the command line client, but instead improve Subversion itself, and you're always free to either use another client, or write your own.

You can use environment variables to shorten the URL, and that's what I do. I use bash, so this is in my .bash_profile;

export repo="http://svn.vegicorp.net/repo"

This allows me to use my environment variables:

$ svn co $repo/trunk/project

Perfectly legitimate. In Unix shells, the shell grabs the command line first, interpolates variables and patterns, then passes it onto the command.

At one time, I've also wrote my own svn shell script that memorized repositories and branches and shorten long commands such as diffs:

$ mysvn branch foo
$ mysvn repo $repo
$ mysvn co project               # svn co $repo/branches/foo/project
$ mysvn bdiff trunk 4.1 project  # svn diff $repo/trunk/project $repo/branches/4.1/project

I don't use it anymore (I've gotten use to Subversion and don't mind the long typing), but it's something you could easily do.