Subversion
From IdefixWiki
Contents |
Create a new repository
svnadmin create /usr/local/svn/jujutsu chown -R idefix !$ chgrp -R subversion !$ chmod -R 770 !$
Import data into the new repository
cd mkdir jujutsu cd !$ mkdir branches mkdir tags mkdir trunk svn import . file:///usr/local/svn/jujutsu -m "Initial import" cd .. rm -R jujutsu
First checkout
svn co file:///usr/local/svn/jujutsu/trunk jujutsu svn co svn+ssh://host/usr/local/svn/jujutsu/trunk jujutsu
Creating a branch
We have a repository in the style:
branches/ tags/ trunk/
in the directoy trunk we have the head version. To create a branch for the files in trunk execute:
svn copy trunk branches/asterisk_idefix.fechner.net
Check if everything is fine with:
svn status A + branches/asterisk_idefix.fechner.net
Then commit the changes to the repository:
svn commit -m "Branch for asterisk configuration at host idefix.fechner.net created"
Send Commit Mails
In your repository on your server there is a directory hooks. Copy the file post-commit.tmpl to post-commit. Now edit it and adapt the lines, I use the following:
/usr/share/subversion/hook-scripts/commit-email.pl "$REPOS" "$REV" svn-commit@<host> \
--from svn-commit@<host>
Now make it executable. At every checkin an e-mail is sent to the above mentioned email address.
Move Repository to another Computer
Make a dump of the current backup:
svnadmin dump path >svn_dump_path
Copy the file to your new computer and do the following there:
svnadmin create newrepository svnadmin load newrepository < svn_dump_path
SVN Acces via http://
Add to your vitual host:
<Location /svn> DAV svn SVNPath /usr/local/svn/overlay </Location>
Now you can access it with:
svn co http://overlay.idefix.lan/svn/trunk
Send Commit Mails
At first search the path for the mailer.py on FreeBSD it is:
/usr/local/share/subversion/hook-scripts/mailer/mailer.py
On Debian:
/usr/share/subversion/hook-scripts/mailer/mailer.py
I will continue with configuration for FreeBSD feel free to replace the path for other systems.
Go into your repository hook path, in my case /usr/local/svn/test/hooks
mv post-commit.tmpl post-commit chmod +x post-commit
Now edit post-commit and add the link to the commit notify program (maybe you have to delete a link to a perl script):
/usr/local/share/subversion/hook-scripts/mailer/mailer.py commit "$REPOS" "$REV"
Now search on your disk for the file mailer.conf.example and copy it into the conf directory under your repository:
cp /usr/local/share/subversion/hook-scripts/mailer/mailer.conf.example /usr/local/svn/test/conf/mailer.conf
Edit the file, I had to change:
mail_command = /usr/sbin/sendmail from_addr = commit@bla to_addr = email@bla reply_to = commit@bla
No commit something to your repository and check if it sends mails.
