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

Re: Debian upgrade

From: Dave Rolsky <autarch_at_urth.org>
Date: 2004-02-04 20:17:19 CET

On Wed, 4 Feb 2004 kfogel@collab.net wrote:

> Kai Hendry <hendry@cs.helsinki.fi> writes:
> > On Wed, Feb 04, 2004 at 01:12:01PM +0100, Jerome Lacoste wrote:
> > > so. You can use svnadmin-<old-version> to dump the repository.
> >
> > I missed this line.
> >
> > It would be nice if all the instruction were verbosely provided here.
> > It's only those three commands.
>
> This is in the FAQ; I don't have the exact URL here, but it's easy to
> find from the website.

Here's a script I wrote to automate this for me, as I have a number of
separate repos.

 #!/usr/bin/perl -w

 use strict;
 use File::Basename;
 use File::Path;

 my ($old, $new, $version) = @ARGV;

 die "Need old repo path, old repo version, and new repo path as arguments."
     unless $old && $new && $version;

 my $static_exe = "svnadmin-$version-1";
 my $path_to_exe = `which $static_exe`;
 chomp $path_to_exe;
 die "Cannot find $static_exe executable."
     unless -x $path_to_exe;

 foreach my $old_repo ( glob "$old/*" )
 {
     next unless -d $old_repo;

     my $mode = (stat _)[2];

     my $new_repo = "$new/" . basename($old_repo);

     unless ( -d $new_repo )
     {
         mkpath( $new_repo, 1 );

         # we really want to recreate the old permissions exactly.
         umask 0000;
         chmod $mode, $new_repo
             or die "Cannot chmod $new_repo: $!";
     }

     system( "svnadmin create $new_repo" )
         and die $!;

     system( "$static_exe dump $old_repo | svnadmin load $new_repo" )
         and die $!;
 }

-dave

/*=======================
House Absolute Consulting
www.houseabsolute.com
=======================*/

---------------------------------------------------------------------
To unsubscribe, e-mail: users-unsubscribe@subversion.tigris.org
For additional commands, e-mail: users-help@subversion.tigris.org
Received on Wed Feb 4 20:17:50 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.