How to install SVN for Odoo Development

SVN is an open source version control system used to store historical changes of your project files such as documentation, coding etc. Here is more information on how to install SVN for Odoo Development in Ubuntu 12.04.

Before installing SVN, you have to install and configure Apache webserver.

Press ALT + CTR + T to open terminal in ubuntu.
Install and configure Apache webserver for SVN.

Step 1) Issue the below command to install apache2 web server.
[email protected]:~$ sudo apt-get install apache2

Step 2) Open this file /etc/apache2/httpd.conf and add the below line.
ServerName localhost

Step 3) Restart apache service
[email protected]:~$ sudo /etc/init.d/apache2 restart

Now install and configure SVN
Step 5)Type the below command to install SVN packages.
[email protected]:~$ sudo apt-get install subversion libapache2-svn

Step 6)After installation,As per your needs, start creating repositories.
[email protected]:~$ sudo mkdir /svn

Step 7)Create a repository test using the below command
[email protected]:~$ sudo svnadmin create /svn/test

Step 8) Change the owner for the repository.
[email protected]:~$ sudo chown -R www-data:www-data /svn/test

Step 9) Create a file to store user authentication details (/etc/subversion/repo.users).
[email protected]:~$ sudo htpasswd -c /etc/subversion/repo.users nevpro
New password:
Re-type new password:
Adding password for user nevpro

Step 10) Create /etc/apache2/conf.d/svn.conf file and add the below lines.
<location /repos>
DAV svn
# SVN path
SVNParentPath /svn/
AuthType Basic
AuthName “Authorization Realm”
#password file path
AuthUserFile /etc/subversion/repo.users
Require valid-user

Step 11) Now restart apache web service.
You have successfully installed and configured SVN server on ubuntu 12.04 for odoo developement.

Step 12) For a quick testing , you can access http://yourip/repos/projectname

Step 13) You can test checkout and commit using command line
create a folder to checkout
[email protected]:~$ mkdir svntest

checkout new copy to svntest folder using the below command.
[email protected]:~$ svn co http://[email protected]/repos/projectname svntest/

create some files
[email protected]:~$ cd svntest/
[email protected]:~/svntest$ touch test1.txt
[email protected]:~/svntest$ touch test2.txt

add the files before commit.
[email protected]:~/svntest$ svn add test1.txt test2.txt
A test1.txt
A test2.txt

now commit the added files ..
[email protected]:~/svntest$ svn commit
Adding test1.txt
Adding test2.txt
Transmitting file data ..
Committed revision 1.

Now open your repository in the browser,you can see the committed files.