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

Re: updating directory after non-recursive checkout

From: Jay Berkenbilt <ejb_at_ql.org>
Date: 2004-03-25 21:07:41 CET

I've thought of one possible solution to this problem:

> One of my CVS repositories holds several dozen small "job-specific"
> programs that support production work on a specific job for a specific
> client. Our repository looks like this:
> software/
> jobutil/
> 101/
> 102/
> 103/
> ...
> where each numbered directory is for one job. Most developers are
> only working on a few jobs at a time, and most of the software is
> stable and doesn't require much modification. Our procedure in CVS is
> to do a non-recursive checkout of software/jobutil and then to get a
> directory that we need with cvs update. For example:
> cvs co -l software # -l is "local", i.e., non-recursive
> cd software
> cvs update -ld jobutil
> cd jobutil
> cvs update -dP 103

Organize the repository as follows:


Under /skel, create an empty directory structure that has the top
level directories of all the separate things people may want to work
on individually. Check out from skel by default, rather than trunk.
Then use svn switch to switch individual subdirectories to trunk (or a
branch or tag) and do the real work there.

For example:

; alias svn-url="svn info | awk '"'/^URL:/ {print $NF}'"'"
; alias svn-trunk='svn-url| sed -e s,/skel/,/trunk/,'
; alias svn-skel='svn-url| sed -e s,/trunk/,/skel/,'

; svnadmin create /tmp/repo
; R=file:///tmp/repo
; svn co $R
Checked out revision 0.
; cd repo
; svn mkdir skel trunk branches tags
; cd skel
; svn mkdir software software/jobutil
; cd jobutil
; svn mkdir 101 102 103
; cd ../../..
; svn ci -mnew
; cd ..
; rm -rf repo

; svn copy -mnew $R/skel/software $R/trunk

Now all developers check out skel like this:

; svn co $R/skel/software

If I want to work on job 101:

; cd software/jobutil/101
; svn switch `svn-trunk`

Start working normally.

To add a new project:

; cd ..../software/jobutil
; svn-url
; svn mkdir -mnew `svn-url`/104
; svn copy -mnew `svn-url`/104 `svn-trunk`/104
; svn update
; cd 104
; svn switch `svn-trunk`

When I'm finished working and don't want 104 "checked out in my
sandbox" (to use CVS terminology), I can just cd to 104 and run

; svn switch `svn-skel`

Can anyone comment on this or think of something better? With a few
scripts to help enforce policy (like having a script that does the add
in skel, copy to trunk, and switch in one operation), this could
actually work very well and would be smoother than CVS because you
wouldn't have to worry about whether to include -d or not depending on
where you were.

Jay Berkenbilt <ejb@ql.org>
To unsubscribe, e-mail: users-unsubscribe@subversion.tigris.org
For additional commands, e-mail: users-help@subversion.tigris.org
Received on Thu Mar 25 21:08:14 2004

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