You are viewing a plain text version of this content. The canonical link for it is here.
Posted to users@subversion.apache.org by Sensei <se...@tin.it> on 2005/07/04 16:40:58 UTC

CVS like environment?

Hi! I've read the docs, and I can't find a way of having svn use just  
environment variables like

CVSROOT

All I can find is using SVN_SSH and the editor, but... is there a way  
of NOT specitying an URL?

So, from    svn ACTION URL module
To          svn ACTION module

Thank you!
-- 
Sensei <se...@tin.it>

cd /pub
more beer

---------------------------------------------------------------------
To unsubscribe, e-mail: users-unsubscribe@subversion.tigris.org
For additional commands, e-mail: users-help@subversion.tigris.org

Re: CVS like environment?

Posted by Saulius Grazulis <gr...@akl.lt>.
On Tuesday 05 July 2005 07:18, Andy Peters wrote:

> > without caring about the environment... I wanted to do something like  
> > that for subversion:
> >
> > svn co myProject
> > ...
>
> What's so difficult about:
>
> $ svn co svn://repos/myProject

Its usually more than that:

$ svn co 
svn+ssh://svnserver.our.domanin.org/home/svnuser/repositories/students/2005/my-project/trunk,

and this is already more than most humans want to type (even if it is onlu for 
the first checkout... ;)

-- 
Saulius Gražulis

Visuomeninė organizacija "Atviras Kodas Lietuvai"
P.Vileišio g. 18
LT-10306 Vilnius
Lietuva (Lithuania)

tel/fax:      (+370-5)-210 40 05
mobilus:      (+370-684)-49802, (+370-614)-36366

Re: CVS like environment?

Posted by Andy Peters <de...@latke.net>.
Sensei wrote:
> 
> On Jul 4, 2005, at 12:49pm, Ben Collins-Sussman wrote:
> 
>>
>> No, there's no way of not specifiying the URL.  Typically, it  doesn't 
>> matter either.  You checkout a working copy of the URL, and  then the 
>> working copy remembers it for you.  Most commands don't  require a URL 
>> argument at all, or automatically use the one cached  in your working 
>> copy.
>>
>> You can also just use environment variables:
>>
>>   export R=scheme://host/path
>>   svn checkout $R/project working-copy
> 
> 
> My problem is with  my students. I provide a .bashrc with useful  
> command lines, like
> 
> cvslab()
> {
>   save old CVSROOT, CVS_RSH, CVSEDITOR
>   new CVSROOT & Co
>   cvs $@
>   restore CVS environment
>   unset backup variables
> }
> 
> So they can just
> 
> cvslab co myProject
> cvslab diff ...
> ...
> 
> without caring about the environment... I wanted to do something like  
> that for subversion:
> 
> svn co myProject
> ...

What's so difficult about:

$ svn co svn://repos/myProject

?

-a



---------------------------------------------------------------------
To unsubscribe, e-mail: users-unsubscribe@subversion.tigris.org
For additional commands, e-mail: users-help@subversion.tigris.org

Re: CVS like environment?

Posted by kf...@collab.net.
Sensei <se...@tin.it> writes:
> > I guess this is about the best you can do here as there's no
> > equivalent to CVSROOT for SubVersion... and you normally only need
> > the repository URL for checkouts and merges anyway, all other
> > commands take the repository URL that is stored in the working copy.
> 
> I see... ok, I will do that. Or ar least I will make a script with
> some tricks...
> 
> A question... why no SVNROOT? I mean, it's quite a big deal having it
> like CVS, it helps a lot...
> 
> Is it planned to port it? Would it be accepted?

I doubt it would be (speaking only my opinion, though).  But there's
an easy workaround, just define it as an environment variable and use
it explicitly in your commands, e.g.:

   prompt> svn co $SVNROOT/trunk/ myproj

-Karl


---------------------------------------------------------------------
To unsubscribe, e-mail: users-unsubscribe@subversion.tigris.org
For additional commands, e-mail: users-help@subversion.tigris.org

Re: CVS like environment?

Posted by Sensei <se...@tin.it>.
On Jul 5, 2005, at 3:18am, Marc Haisenko wrote:

>
> I guess this is about the best you can do here as there's no  
> equivalent to CVSROOT for SubVersion... and you normally only need  
> the repository URL for checkouts and merges anyway, all other  
> commands take the repository URL that is stored in the working copy.

I see... ok, I will do that. Or ar least I will make a script with  
some tricks...

A question... why no SVNROOT? I mean, it's quite a big deal having it  
like CVS, it helps a lot...

Is it planned to port it? Would it be accepted?

-- 
Sensei <se...@tin.it>

cd /pub
more beer


---------------------------------------------------------------------
To unsubscribe, e-mail: users-unsubscribe@subversion.tigris.org
For additional commands, e-mail: users-help@subversion.tigris.org

Re: CVS like environment?

Posted by Marc Haisenko <ha...@webport.de>.
On Monday 04 July 2005 20:00, Sensei wrote:
> My problem is with  my students. I provide a .bashrc with useful
> command lines, like
>
[...]
>
> So they can just
>
> cvslab co myProject
> cvslab diff ...
> ...
>
> without caring about the environment... I wanted to do something like
> that for subversion:
>
> svn co myProject
> ...

Why don't you just set an environment variable of the repository URL and 
document that for your students ? Say, you set a variable SVNREPO so your 
students can do:

svn co $SVNREPO/foo

I guess this is about the best you can do here as there's no equivalent to 
CVSROOT for SubVersion... and you normally only need the repository URL for 
checkouts and merges anyway, all other commands take the repository URL that 
is stored in the working copy.

C'ya,
	Marc


-- 
Marc Haisenko
Systemspezialist
Webport IT-Services GmbH
mailto: haisenko@webport.de

---------------------------------------------------------------------
To unsubscribe, e-mail: users-unsubscribe@subversion.tigris.org
For additional commands, e-mail: users-help@subversion.tigris.org

Re: CVS like environment?

Posted by Bob Proulx <bo...@proulx.com>.
Sensei wrote:
> Bob Proulx wrote:
> >svnlabco()
> >{
> >  svn checkout scheme://host/path/$1 $1
> >}
> 
> Yes, all I found useful is not specifying the remote each time, and  
> having a single script that works with every command using $@...

Okay.  Then how about this?

svnlab()
{
    case $1 in
	co|checkout)
	    SVNROOT=scheme://host/path/
	    PROJECT=$2
	    shift 2
	    svn checkout "$@" $SVNROOT/trunk/$PROJECT $PROJECT
	    ;;
	*)
	    svn "$@"
	    ;;
    esac
}

Note that $@ is different from "$@".  You almost always want "$@" and
not $@.

Bob

---------------------------------------------------------------------
To unsubscribe, e-mail: users-unsubscribe@subversion.tigris.org
For additional commands, e-mail: users-help@subversion.tigris.org

Re: CVS like environment?

Posted by Ben Collins-Sussman <su...@collab.net>.
On Jul 5, 2005, at 12:18 PM, Sensei wrote:
>
>
> Yes. Anyway, why is so bad adding an environment variable for  
> remote repositories? I don't understand (really)...


Because it adds extra complexity to the software's code and behavior,  
and your shell already provides the feature.


---------------------------------------------------------------------
To unsubscribe, e-mail: users-unsubscribe@subversion.tigris.org
For additional commands, e-mail: users-help@subversion.tigris.org

Re: CVS like environment?

Posted by Sensei <se...@tin.it>.
On Jul 5, 2005, at 11:50am, Bob Proulx wrote:

> Why is CVSROOT needed for anything after the checkout?  It's not.
> This is the same as for subversion.  So using this for the other
> actions such as diff confuses me.
>
>   cvslab co myProject
>   cvs -qn update
>   cvs status | grep Status: | grep -v Up-to-date
>   cvs diff
>   cvs commit

You're right, anyway it was just a suggestion about this option,  
present in CVS and not in subversion... anyway, it's not even needed  
for checkout... but it's there :)

> You can easily do that for subversion.  Since you have already trained
> them to use the function calls you can continue.
>
> svnlabco()
> {
>   svn checkout scheme://host/path/$1 $1
> }

Yes, all I found useful is not specifying the remote each time, and  
having a single script that works with every command using $@...


> Then your students can do:
>
>   svnlabco myProject
>   svn status
>   svn diff
>   svn commit


Yes. Anyway, why is so bad adding an environment variable for remote  
repositories? I don't understand (really)...

-- 
Sensei <se...@tin.it>

cd /pub
more beer


---------------------------------------------------------------------
To unsubscribe, e-mail: users-unsubscribe@subversion.tigris.org
For additional commands, e-mail: users-help@subversion.tigris.org

Re: CVS like environment?

Posted by Bob Proulx <bo...@proulx.com>.
Sensei wrote:
> My problem is with  my students. I provide a .bashrc with useful  
> command lines, like
> 
> cvslab()
> {
>   save old CVSROOT, CVS_RSH, CVSEDITOR
>   new CVSROOT & Co
>   cvs $@
>   restore CVS environment
>   unset backup variables
> }
> 
> So they can just
> 
> cvslab co myProject
> cvslab diff ...
> ...

Why is CVSROOT needed for anything after the checkout?  It's not.
This is the same as for subversion.  So using this for the other
actions such as diff confuses me.

  cvslab co myProject
  cvs -qn update
  cvs status | grep Status: | grep -v Up-to-date
  cvs diff
  cvs commit

> without caring about the environment... I wanted to do something like  
> that for subversion:

You can easily do that for subversion.  Since you have already trained
them to use the function calls you can continue.

svnlabco()
{
  svn checkout scheme://host/path/$1 $1
}

Then your students can do:

  svnlabco myProject
  svn status
  svn diff
  svn commit

Bob

---------------------------------------------------------------------
To unsubscribe, e-mail: users-unsubscribe@subversion.tigris.org
For additional commands, e-mail: users-help@subversion.tigris.org

Re: CVS like environment?

Posted by Christopher Ness <ch...@nesser.org>.
On Mon, 2005-07-04 at 13:00 -0500, Sensei wrote:
> On Jul 4, 2005, at 12:49pm, Ben Collins-Sussman wrote:
> >
> > No, there's no way of not specifiying the URL.  Typically, it  
> > doesn't matter either.  You checkout a working copy of the URL, and  
> > then the working copy remembers it for you.  Most commands don't  
> > require a URL argument at all, or automatically use the one cached  
> > in your working copy.
> >
> > You can also just use environment variables:
> >
> >   export R=scheme://host/path
> >   svn checkout $R/project working-copy
> 
> My problem is with  my students. I provide a .bashrc with useful  
> command lines, like
>
> without caring about the environment... I wanted to do something like  
> that for subversion:
> 
> svn co myProject
> ...

Write a simple bash script called `svnget` put it in the students path.

usage: svnget MODULE [LOCALNAME]

`svnget` needs to know the structure of the repository, so it can
prepend the server name to the module argument.  The one liner below
knows that all the modules live in the trunk of the repository.

#!/bin/sh
svn co method://server.ca/repos/trunk/$@

Then the students would use `svn diff` in the working copy directory
that is created with the module name - which doesn't require a URL once
the working copy is created.

This is a crutch and just shifts the fact that you need to remember to
use `svnget` instead of the URL of the repository.  I feel the students
should learn how to do this themselves, but that's your call.  

HTH's
Chris
-- 
Wireless Group,
McMaster University

finger.localdomain
14:01:51 up 4:13, 1 user, load average: 0.00, 0.04, 0.09


---------------------------------------------------------------------
To unsubscribe, e-mail: users-unsubscribe@subversion.tigris.org
For additional commands, e-mail: users-help@subversion.tigris.org

Re: CVS like environment?

Posted by Sensei <se...@tin.it>.
On Jul 4, 2005, at 12:49pm, Ben Collins-Sussman wrote:
>
> No, there's no way of not specifiying the URL.  Typically, it  
> doesn't matter either.  You checkout a working copy of the URL, and  
> then the working copy remembers it for you.  Most commands don't  
> require a URL argument at all, or automatically use the one cached  
> in your working copy.
>
> You can also just use environment variables:
>
>   export R=scheme://host/path
>   svn checkout $R/project working-copy

My problem is with  my students. I provide a .bashrc with useful  
command lines, like

cvslab()
{
   save old CVSROOT, CVS_RSH, CVSEDITOR
   new CVSROOT & Co
   cvs $@
   restore CVS environment
   unset backup variables
}

So they can just

cvslab co myProject
cvslab diff ...
...

without caring about the environment... I wanted to do something like  
that for subversion:

svn co myProject
...

-- 
Sensei <se...@tin.it>

cd /pub
more beer

---------------------------------------------------------------------
To unsubscribe, e-mail: users-unsubscribe@subversion.tigris.org
For additional commands, e-mail: users-help@subversion.tigris.org

Re: CVS like environment?

Posted by Ben Collins-Sussman <su...@collab.net>.
On Jul 4, 2005, at 11:40 AM, Sensei wrote:

> Hi! I've read the docs, and I can't find a way of having svn use  
> just environment variables like
>
> CVSROOT
>
> All I can find is using SVN_SSH and the editor, but... is there a  
> way of NOT specitying an URL?
>
> So, from    svn ACTION URL module
> To          svn ACTION module
>

No, there's no way of not specifiying the URL.  Typically, it doesn't  
matter either.  You checkout a working copy of the URL, and then the  
working copy remembers it for you.  Most commands don't require a URL  
argument at all, or automatically use the one cached in your working  
copy.

You can also just use environment variables:

   export R=scheme://host/path
   svn checkout $R/project working-copy



---------------------------------------------------------------------
To unsubscribe, e-mail: users-unsubscribe@subversion.tigris.org
For additional commands, e-mail: users-help@subversion.tigris.org