Subversion

Subversion

Some initial notes on using subversion. Not complete.

remote checkout:

> cd /home/micah/working
> svn checkout svn+ssh://ibis.riseup.net/var/lib/svn/bamboo bamboo

remote checkout, specifying the user:

otheruser> cd /home/otheruser/working
otheruser> svn checkout svn+ssh://micah@ibis.riseup.net/var/lib/svn/bamboo bamboo

local checkout:

svn checkout file:///var/lib/svn/tickquito tickquito

creating a new repository:

svnadmin create /var/lib/svn/repository
chown -R :src /var/lib/svn/repository
chmod -R g+wrs /var/lib/svn/repository

moving a repository

lets say you want to move a repostory from one server to another:

on first server:

 svnadmin dump repository > repository.dump

on second server:

  mkdir /var/lib/svn/riseup
  svnadmin create --fs-type fsfs /var/lib/svn/riseup/<repository>
  svnadmin load /var/lib/svn/riseup/repository < repository.dump 
  chown -R root:src /var/lib/svn/riseup
  chmod -R g+rws /var/lib/svn/riseup

finally, each person who has the repository checked out:

  cd <repository>
  svn switch --relocate <url-from> <url-to>

for example:
bc. svn switch —relocate svn+ssh://ibis.riseup.net/var/lib/svn/myproject svn+ssh://macaw.riseup.net/var/lib/svn/riseup/myproject

Fixing corrupt repository databases

On the repository server:

  # svnadmin recover /var/lib/svn/<repository>
  # chmod -R g+ws /var/lib/svn/<repository>
  # chown -R :staff /var/lib/svn/<repository>

The group might be different depending on the access that should be given to the repository.

converting a repository from BDB to FSFS

Lets say you keep getting database corruption errors and are sick of it. Lets say you read svn.collab.net/repos/svn/trunk/notes/fsfs and decided that FSFS was a better backend storage mechanism than BDB so you wanted to switch to it. This is how you do it:

  # svnadmin dump /var/lib/svn/<repository> > /tmp/<repository>.dump
  # rm -rf /var/lib/svn/<repository>
  # svnadmin create --fs-type fsfs /var/lib/svn/<repository>
  # svnadmin load /var/lib/svn/<repository> < /tmp/<repository>.dump
  # chown -R :staff /var/lib/svn/<repository>
  # chmod -R g+ws /var/lib/svn/<repository>