Posts Tagged ‘subversion’

Recursively remove .svn directories in Linux

Sometimes it’s necessary to get rid of all the .svn directories in a subversion managed project. You can easily do this on the Linux console by executing

rm -rf `find . -type d -name .svn`

in the base directory of the project.

Installing Post-Commit-Hook for Subversion and Trac 0.11

If you have a Subversion running including a Trac connection, it’s nice to have the post-commit-hook running, too.

With this hook, you can include additional keywords (closes, fixes) in commit-comments which then allow to close, fix etc. tickets.

I installed it in the following way.

My Subversion directory is in this case /svn and my Trac directory is /trac.

mkdir -p /usr/share/trac/contrib
cd /usr/share/trac/contrib
wget http://trac-hacks.org/export/7848/timingandestimationplugin/branches/trac0.11/scripts/trac-post-commit.py

Now the SVN settings

cd /svn/hooks
vim post-commit

Add this content to the post-commit file (via http://trac-hacks.org/wiki/TimingAndEstimationSVNPostCommitHook):

#!/bin/sh
REPOS="$1"
REV="$2"
LOG=`svnlook log -r $REV $REPOS`
AUTHOR=`svnlook author -r $REV $REPOS`
TRAC_ENV='/trac'

/usr/bin/python /usr/share/trac/contrib/trac-post-commit.py \
-p "$TRAC_ENV"  \
-r "$REV"       \
-u "$AUTHOR"    \
-m "$LOG"

Change some privileges and owner-ships:

chown www-data:www-data post-commit
chmod 755 post-commit

rapidsvn. A multi-platform GUI front-end for the Subversion revision system

rapidsvn_logoWhenever i need to manage my subversion repository, i am using rapidsvn under Ubuntu. Pretty simple interface, but it fullfills its purpose.

Recovering a deleted file in Subversion

svn up -r 3838 myfile.test

In this case 3838 is the number of the revision in which the file existed.

error: Unexpected HTML page found at http://trac-hacks.org/svn/accountmanagerplugin/0.10

I got the following error:

error: Unexpected HTML page found at http://trac-hacks.org/svn/accountmanagerplugin/0.10

To fix it, you need to update setuptools via

sudo easy_install -U setuptools

Backup a subversion repository

Dumping it into a file (e.g. repository.dump)

svnadmin dump /path/to/repository > repository.dump

Loading the dumped file back into a repository

svnadmin load /path/to/repository < repository.dump