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

RE: svn export question

From: Stephen Warren <swarren_at_paramanet.com>
Date: 2004-04-20 20:48:55 CEST

> From: Henderson, Michael D [mailto:michael.d.henderson@lmco.com]
> I'm trying to figure out how our O&M people will pull scripts
> out of the repository to set up the production environment.
> I'm thinking that I don't want them to do a svn checkout,
> mostly because I don't want them thinking that it's okay to
> update scripts there. svn export looks promising, but I
> receive a warning that worries me.
> svn export svn://zinc .
> subversion/clients/cmdline/export-cmd.c:77: (apr_err=155000)
> svn: Destination directory exists; Please remove the
> directory or use --force to ovewrite.
> subversion/libsvn_client/export.c:287: (apr_err=155000)
> svn: '' already exists

you can export into a temporary "staging" directory, then swap the staging into the production location. I use the script below.

There is a tiny window where the "production/xxx" directory doesn't exist, but I feel that's better than having a larger window where "svn export" is half way through updating the "production/xxx" directory and hence it's in an inconsistent state.


if [ "$website" == "" ]; then
    exit 1

cd /usr/local/apache-2.0.49/htdocs

echo @@@@@ Removing old staging directory

rm -rf staging/$website
mkdir -p staging

echo @@@@@ Pulling files from SVN

svn --username xxxxx export https://server:443/repos/$website/ staging/$website
if [ $? != 0 ]; then
    echo SVN EXPORT FAILED: $?
    exit 1

if [ $? != 0 ]; then
    echo SCRIPT post_staging_export.sh FAILED: $?
    exit 1

echo @@@@@ Promoting staging to production

rm -rf production-old/$website
mkdir -p production-old
mv production/$website production-old/$website
mv staging/$website production/$website

Stephen Warren, Software Engineer, Parama Networks, San Jose, CA
To unsubscribe, e-mail: users-unsubscribe@subversion.tigris.org
For additional commands, e-mail: users-help@subversion.tigris.org
Received on Tue Apr 20 20:50:45 2004

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.