gatopanda.com

  • Aumentar el tamaño de la letra
  • Tamaño de letra predeterminado
  • Reducir el tamaño de la letra
Home Fast Scripting Aplicaciones Making a local mirror of a subversion repository: using svnsync

Making a local mirror of a subversion repository: using svnsync

Correo electrónico Imprimir PDF

For various reasons, it may be good to have a mirror of a given svn repository (by mirror, I mean a full copy of all the history), for example to have faster access to the history if you have slow connection, or, as in my case, to enable simpler import to other source control systems (bzr, hg, etc…). Subversion comes with a tool, svnsync, but there is not much documentation on it, and the one I found was not accurate, or at least did not work for me. So here are a the exact steps which made it work for me, on Ubuntu (7.10, but I don’t think the version matters as long as you have svnsync and a relatively recent subversion client).

I will assume for the rest of this mini-tutorial that the repository you want to copy is ORIG (which should point to a valid svn repository, for example http://svn.scipy.org/svn/numpy. Note that it must be the repository URL, not trunk or anything), and the one to copy is COPY (this one will be a pathname). The first thing to do is to create a local subversion repository on your machine:

svnadmin create $COPY

Check that you create correctly the repository at the right path:

svn info file://$COPY

Now, create the following hook into the mirror repository: $COPY/hooks/pre-revprop-change, and put the following content into it

#!/bin/sh USER="$3" if [ "$USER" = "svnsync" ]; then exit 0; fi echo "Only the svnsync user can change revprops" >&2 exit 1

This is so that only the svnsync user can  modify the revprops, which is necessary for the mirror. The file must be executable:

chmod +x $COPY/hooks/pre-revprop-change

Now, you can initialize the synchronisation (e.g. the mirroring):

svnsync init --username svnsync file://$COPY $ORIG

If successfull, it should tell you something like ” Copied properties for revision 0″. You can now start the mirroring (which will take time, depending on your network connection, and the size of the repository of course).

svnsync sync file://$COPY
Última actualización el Martes 12 de Enero de 2010 23:38  

Nice Social Bookmark

Facebook MySpace Twitter Digg Delicious Stumbleupon Google Bookmarks RSS Feed 

Newsflash

Yesterday all servers in the U.S. went out on strike in a bid to get more RAM and better CPUs. A spokes person said that the need for better RAM was due to some fool increasing the front-side bus speed. In future, buses will be told to slow down in residential motherboards.