[svn.haxx.se] · SVN Dev · SVN Users · SVN Org · TSVN Dev · TSVN Users · Subclipse Dev · Subclipse Users · this month's index

Re: The use of SVNROOT

From: Ryan Schmidt <subversion-2010a_at_ryandesign.com>
Date: Fri, 5 Mar 2010 17:01:03 -0600

On Mar 5, 2010, at 14:11, Eramo, Mark wrote:

> I am working with Subversion 1.6.9 and was wondering if there was a way to setup the SVNROOT variable so that I do not have to type it every time I for example, need to checkout a new project.
>
> With cvs, we defined cvsroot in our env. It was for example CVSROOT=pserver:/usr/local/cvsroot
>
> Then when we did a cvs checkout, it resolved cvsroot automatically
>
> Instead of having to type cvs co /usr/local/cvsroot/path/to/project All we had to do was type cvs co path/to/project
>
> Trying to figure out if there is a way to do this with SVNROOT so that instead of typing svn co $SVNROOT/path/to/project, I could just type svn co /path/to/project and have it automatically resolve $SVNROOT.

There is no equivalent of CVSROOT in Subversion. But when it has been asked for before, the response has been: what do you need it for? If you just want a shortcut for checking out, define an environment variable and use that. This is what I do in my ~/.bashrc:

export M="http://svn.macosforge.org/repository/macports"

Then I can for example:

svn checkout $M/trunk/dports

or

svn log $M --limit 5

I use the variable "M" because it's easy to remember that it stands for MacPorts and I'm not using it for anything else, but you can name it anything you want, or define multiple env vars for multiple repositories or multiple paths within a repository (for example, a separate variable for the trunk, or for a deep path within the repo that you often want to refer to).

Remember, the working copy stores the repository URL it was checked out from, so the only time you need the repository URL is when you're checking out or when you're asking for a log or similar function and aren't already sitting in the working copy's directory.
Received on 2010-03-06 00:01:42 CET

This is an archived mail posted to the Subversion Users mailing list.

This site is subject to the Apache Privacy Policy and the Apache Public Forum Archive Policy.