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.


Reply via email to