Loading...
 

Subversion

Initial Setup


It is important to use only one access method or there will be user rights problems with the berkley db files in the repository db directory. The solution I use is to always use http even when on the local system. Note also that my system is completely within an isolated LAN / VPN environment so I chose to use HTTP vs. HTTPS. If you are opening your svn repository to public IP networks you need to take security precautions I don't list here.

Subversion Installation

su -
apt-get install subversion
mkdir /var/svn/
groupadd subversion
  • don't add any unix users to the subversion group. This will prevent users from using file:// access method and require them to use the http:// access method.

Subversion apabhe2-svn Installation

aptitude install libapache2-svn
/etc/init.d/apache2 restart
htpasswd -c /etc/apache2/dav_svn.passwd michael
htpasswd /etc/apache2/dav_svn.passwd another_user


<Location /xPL4Java>
DAV svn
SVNPath /var/svn/xPL4Java
AuthType Basic
AuthName "Subversion Repository"
AuthUserFile /etc/apache2/dav_svn.passwd
Require valid-user
</Location>

Import a Project

Create the Repository

su -
svnadmin create --fs-type fsfs /var/svn/project5
chown -R www-data:subversion /var/svn/project5
chmod -R 770 /var/svn/project5
exit

Initial Import

Create a working directory that contains the files for the existing project
~/project5/trunk/{existing_files}
~/project5/branches
~/project5/tags

svn import -m "Initial import" ~/project5 http://localhost/project5

rm -rf ~/project5
mkdir ~/project5
svn co http://localhost/project5/trunk project5

Local Copy of a 3rd Party Project

3rd party projects require initial and periodic importing of the 3rd party changes while merging with local changes. This can be rather complex; however svn has tools and documentation that address this work flow. The steps below are cheat-sheet notes from the svn manual:

Create the Repository

su -
svnadmin create --fs-type fsfs /var/svn/xPL4Java
chown -R www-data:subversion /var/svn/xPL4Java
chmod -R 770 /var/svn/xPL4Java
exit

Initial Import

mkdir ~/xPL4Java
cd ~/xPL4Java
tar xzf xPL4Java-devel.tgz
tar xzf xPL4Java.tgz
rm xPL4Java/jars/xPL*.jar
mv xPL4Java xPL4Java-20080907

svn import ~/xPL4Java/xPL4Java-20080907 http://localhost/xPL4Java/vendor/current \
-m 'importing initial 2008-09-07 vendor drop'

svn copy http://localhost/xPL4Java/vendor/current http://localhost/xPL4Java/vendor/20080907 \
-m 'tagging 2008-09-07 vendor drop'

svn copy http://localhost/xPL4Java/vendor/20080907 http://localhost/xPL4Java/trunk \
-m 'bringing 2008-09-07 vendor drop into the main branch'

cd ~/xPL4Java
svn co http://localhost/xPL4Java/trunk trunk
cd ~/xPL4Java/trunk

Subsequent Imports and Merges

cd ~
tar xzf xPL4Java-devel.tgz
mv ~/xPL4Java ~/xPL4Java-nextdate_serial

svn_load_dirs.pl -t nextdate_serial http://localhost/xPL4Java/vendor/ \
current ~/xPL4Java-nextdate_serial


  • check out trunk HEAD revision
cd ~/xPL4Java/trunk
svn merge http://localhost/xPL4Java/vendor/20080907 http://localhost/xPL4Java/vendor/current
  • resolve all the conflicts between their changes (diff vendor/20080907 vendor/current) and our changes (current working directory i.e trunk)
svn commit -m 'merging xPL4Java-nextdate_serial into the main branch'

Contributors to this page: michael .
Page last modified on Saturday 03 of April, 2010 18:26:15 CDT by michael.