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

Re: Initial Checkout

From: Ximon Eighteen <ximon.eighteen_at_int.greenpeace.org>
Date: 2005-09-15 12:13:29 CEST

Wim Bekker wrote:
> Hi,
>
> I have a repository like:
>
> repository - products - product1 - trunk
> - product1 - branches
> - product1 - tags
> - product2 - trunk
> - product2 - branches
> - product2 - tags
> - libraries- library1 - trunk
> - library1 - branches
> - library1 - tags
> - library2 - trunk
> - library2 - branches
> - library2 - tags
>
> etc.
>
> For an initial checkout, I want to checkout only the trunk directories.
>
> How can I do that from the root of the repository. I don't want to go
> into each project to check out because there are to many projects.

One way (I don't like this but it should work):- (ASSUMES LINUX ENVIRONMENT)

Create a script called co_sub_dir.sh with this content (tested on Bash 3.00.16
on Linux 2.6.10):

----- cut -----
#!/bin/bash
REPOS_URL=$1
PATH=$2

MKDIR=/bin/mkdir
SVN=/usr/local/subversion/bin/svn

pushd .
$MKDIR -p $PATH
cd $PATH
$SVN co $REPOS_URL/$PATH
popd
----- cut-----

Make sure you set the MKDIR and SVN paths correctly for your system. Then
issue this command.

export REPOS_URL=https://my.svn.server/repository
svn ls -R $REPOS_URL | grep '/trunk/$' | xargs -i bash co_sub_dir $REPOS_URL {}

Tested and works on my system, but ugly.

X

---------------------------------------------------------------------
To unsubscribe, e-mail: users-unsubscribe@subversion.tigris.org
For additional commands, e-mail: users-help@subversion.tigris.org
Received on Thu Sep 15 12:17:53 2005

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.