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.
svn@nevpro:~$ 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
svn@nevpro:~$ sudo /etc/init.d/apache2 restart

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

Step 6)After installation,As per your needs, start creating repositories.
svn@nevpro:~$ sudo mkdir /svn

Step 7)Create a repository test using the below command
svn@nevpro:~$ sudo svnadmin create /svn/test

Step 8) Change the owner for the repository.
svn@nevpro:~$ sudo chown -R www-data:www-data /svn/test

Step 9) Create a file to store user authentication details (/etc/subversion/repo.users).
svn@nevpro:~$ 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
svn@nevpro:~$ mkdir svntest

checkout new copy to svntest folder using the below command.
svn@nevpro:~$ svn co http://nevpro@ svntest/

create some files
svn@nevpro:~$ cd svntest/
svn@nevpro:~/svntest$ touch test1.txt
svn@nevpro:~/svntest$ touch test2.txt

add the files before commit.
svn@nevpro:~/svntest$ svn add test1.txt test2.txt
A test1.txt
A test2.txt

now commit the added files ..
svn@nevpro:~/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.

Leave a Reply