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

RE: Make it simpler to create a new project

From: Lübbe Onken <l.onken_at_rac.de>
Date: 2006-12-18 10:17:13 CET

Hi Nick Lindridge,

You wrote:
> well, and not much needs to be read. However I have to agree with
> Nicholas too as far as creating repositories is concerned, as
> whilst it's
> easy, it's also a an effort and time consuming when it should be a 5
> second job and not a 5 minute on.

Setting up a repository *is* a 5 second job and TortoiseSVN is not the tool
for it. If you just need a playground, create a local repository with
TortoiseSVN in 5 seconds. If you want to do *real* work, you have to place
your repositories on a server including all the server setup, backup stuff
and so on.

Then spend 20 Minutes designing you default repository layout or find it out
the hard way by trial and error over months. When you have reached the state
of enlightenment, create such a repository including readme files, custom
hook scripts and whatever you need. Dump that repository and copy the dump
and the hook scripts to a safe location.

Write a batch script that does all the manual steps involved in setting up a
proper repository. A unix example is below. The dump file (two revisions)
with the default layout is loaded and the two revision dates are changed.
Otherwise the first two revisions of each repository would contain the
creation date of the template.
The script contains some sophisticated stuff like placing the hooks section
of the repository under version control, thus allowing customization of
(some) hooks by clients.
Creating a repository takes me less than 30 Seconds now, including the time
needed to log into the server.

--- BEGIN mkrepos.sh ---
#/bin/sh
#
# Little shell script to create a repository
#
# A pre-configured repository is loaded from a dump file
# Default hooks are copied into the repository which cannot be modified
# Customizable hooks (part of the dump file) are checked out

SVNADMIN=/usr/bin/svnadmin
SVN=/usr/bin/svn
DATUM=`date -u +%Y-%m-%dT%H:%M:%S.`

REPOS=${1}
if [ x$REPOS = x ] ; then
echo "usage: $0 REPOS_PATH"
exit
fi
BASE=/svn/repository/$1

# Create and load repository from dumpfile
mkdir ${BASE}
${SVNADMIN} create ${BASE}
${SVNADMIN} load ${BASE} < conf/dumpfile

# Get rid of templates and copy our default hooks into repository
rm ${BASE}/hooks/*.tmpl
cp conf/hooks/* ${BASE}/hooks

# Change ownership to svn, so the repository can be accessed by everyone
chown -R svn:svn ${BASE}

# Set date of first revisions to current date
svn propset svn:date --revprop -r 0 ${DATUM}0Z file://${BASE}
svn propset svn:date --revprop -r 1 ${DATUM}1Z file://${BASE}

# Checkout customizable hooks and change their ownership to svn
${SVN} checkout file://${BASE}/hooks/ ${BASE}/hooks/
chown -R svn:svn ${BASE}/hooks/
--- END mkrepos.sh ---

Cheers
- Lübbe

--
       ___
  oo  // \\      "De Chelonian Mobile"
 (_,\/ \_/ \     TortoiseSVN
   \ \_/_\_/>    The coolest Interface to (Sub)Version Control
   /_/   \_\     http://tortoisesvn.net
---------------------------------------------------------------------
To unsubscribe, e-mail: dev-unsubscribe@tortoisesvn.tigris.org
For additional commands, e-mail: dev-help@tortoisesvn.tigris.org
Received on Mon Dec 18 10:17:27 2006

This is an archived mail posted to the TortoiseSVN Dev mailing list.