Tag Archive for svn

Migrate/move subversion repository

#In the old server shell
svnadmin dump /path/to/repository > repository-name.dmp

#In the new server
cd /path/to/new-repository
svnadmin create repository-name
svnadmin load repository-name < repository-name.dmp

source

Delete SVN Files

find ./ -name ".svn" | xargs rm -Rf

source

Propset SVN-Keywords

svn propset svn:keywords "Date Author Revision HeadURL Id LastChangedDate" *.java

source

Howto list all the file extension types in an SVN log dump

svn log -v > myrepo.log

perl -ne 'print qq{$1
} if m{^s+.*(.[^.s]w+)$}' myrepo.log | sort | uniq -c | sort -r

source

CLI Sync Command for Warehouse SVN Repository Browser

rake warehouse:sync RAILS_ENV=production

source

SVN Export All Files Changed Between 2 Revisions

#!/bin/bash
if test ! $1; then
    echo "Missing required arguments: repo path, rev1, rev2"
    exit 0
fi

DOMAIN='<a href="http://your.svnrepository.com'" >http://your.svnrepository.com'</a>
REPO=$1
REV1=$2
REV2=$3
for i in $(svn diff --summarize -r $REV1:$REV2 $DOMAIN$REPO | awk '{ print $2 }'); 
    do p=$(echo $i | sed -e "s{$DOMAIN$REPO/{{"); 
    mkdir -p $(dirname $p); 
    svn export $i $p; 
done

source

Recursively remove .svn folders

#!/usr/bin/perl

sub cleanup {
        my $dir = shift;
	local *DIR;

	opendir DIR, $dir or return false;
	for (readdir DIR) {
	        next if /^.{1,2}$/;
	        my $path = "$dir/$_";
		unlink $path if -f $path;
		cleanup($path) if -d $path;
	}
	closedir DIR;
	rmdir $dir;
	return true;
}


sub cleansvn {
	my $dir = shift;

	cleanup ("$dir/.svn");
	
	local *DIR;

	opendir DIR, $dir or die "opendir $dir: $!";
	for (readdir DIR) {
	        next if /^.{1,2}$/;
	        my $path = "$dir/$_";
		cleansvn($path) if -d $path;
	}
	closedir DIR;
}


cleansvn(".");

source

Beanstalk svn initial import

svn import [absolute path to working root dir] <a href="http://[username].svn.beanstalkapp.com/[repo" >http://[username].svn.beanstalkapp.com/[repo</a> name]/trunk -m "Initial import"

source

Create new repository

svnadmin create --fs-type fsfs MyNewRepository

source

Copy a svn repository

svnadmin hotcopy PATH_TO_REPOS PATH_TO_MIRROR

source