Benutzer-Werkzeuge

Webseiten-Werkzeuge


becki:linux:svn_tips

Dies ist eine alte Version des Dokuments!


Subversion Tips

Apache Server Configuration

  • Add the following to /etc/httpd/httpd.conf and restart Apache:
LoadModule dav_svn_module lib/httpd/modules/mod_dav_svn.so
LoadModule authz_svn_module lib/httpd/modules/mod_authz_svn.so

<Location /svn>
  DAV svn
  SVNParentPath /home/svn
  SVNListParentPath on
  AuthType Digest
  AuthName "Subversion Repositories"
  AuthUserFile /home/svn/.htpasswd
  AuthDigestProvider file
  Require valid-user
</Location>
  • Create the directiory /home/svn
  • Type svnadmin create /home/svn/test to create a repository called test
  • Type chown -R apache:apache /home/svn/*
  • Point your browser to http://localhost/svn to browse the repository/ies

svnserve Server Configuration

Required

Server OS is Slackware Linux 11.0. Infos are collected from the svnbook and this site. The easiest alternative for running a svn server is used, i.e. svnserve as daemon. No apache, no SSH is used:

su -
groupadd svn
useradd -g svn -d /home/svn svn
mkdir /home/svn
chown svn:svn /home/svn
su svn
rm /home/svn/.* # delete .bash_history
svnadmin create /home/svn
exit
chmod -R o-rwx /home/svn

Note: The svnserve process ist started as a separate user svn as recommended. This increases security, but seems to prevent local access via file:///home/svn/... urls.

To start svnserve at boot time, append this to /etc/rc.d/rc.local:

su svn -c "/usr/bin/svnserve -d -r /home/svn"

To give users access to the repository, edit /home/svn/conf/svnserv.conf and /home/svn/conf/passwd see Built-in authentication and authorization

Browser Interface Configuration

This is optional. www.viewvc.org is mentioned in svnbook and used. Viewvc requieres Subversion with its SWIG Python bindings. Install swig e.g. from linuxpackages.

The Subversion which comes with Slack 11.0 is compiled witout swig/python support. Therefore download from the Slack source subversion dir, eg form here.

Now the buildscript subversion.SlackBuild has to be patched a bit in order to include the python bindings:

53a54
> make swig-py || exit 1
55a57
> make install-swig-py DESTDIR=$PKG
88a91,93
> mkdir -p $PKG/usr/lib/python2.4/site-packages
> echo "/usr/lib/svn-python" > $PKG/usr/lib/python2.4/site-packages/svn.pth
> 

Run the buildscript to create a the package and install the package with upgradepkg –reinstall subversion-1.4.0-i486-1.tgz

Install viewvc by running viewrc-install (described in viewrc-1.0.4/INSTALL)

Edit /usr/local/viewrc-1.0.4/viewrc.conf:

80c80
< #svn_roots = svn: /home/svnrepos
---
> svn_roots = svn: /home/svn
105c105
< default_root = cvs
---
> default_root = svn

Copy (symlinks don't work) /usr/local/viewrc-1.0.4/bin/cgi/*.cgi to /var/www/cgi-bin

Add user nobody (Apache) to group svn in /etc/group to give Apache read permission for the svn repository. Then restart Apache and point your browser to http://server-hostname/cgi-bin/viewvc.cgi/.

Client Configuration

If you use the provieded command line svn client no config at all is necessary. This is also true if Cygwin is used as environment. Username and password are stored automatically after first login, see client credentials caching.

Client Usage

Commands refere to the SVN command line client which comes with SVN

First Import

Create a project. 3 directories are recommended:

becki@client:~/test$ tree testproj/
testproj/
|-- branches
|-- tags
`-- trunk
    `-- main.c

The import command imports the testproj project to the root dir of the repostitory also as project testproj

becki@client:~/test$ svn import testproj svn://server-hostname/testproj

Checkout

svn co svn://etb-111/testproj

Check working copy status

svn st [-u] [-v] [file or dir]
  • -u adds working revision and server out-of-date information
  • -v prints full revision information on every item

See svn.ref.svn.c.status.html

Give up working copy

According to http://svn.haxx.se/dev/archive-2002-08/1385.shtml there is no command like the release of CVS. Just delete the working copy locally.

Move Files and Dirs

svn move <from> <to>

Work just like shell mv command :-) See svn.ref.svn.c.move.html

Cookies helfen bei der Bereitstellung von Inhalten. Diese Website verwendet Cookies. Mit der Nutzung der Website erklären Sie sich damit einverstanden, dass Cookies auf Ihrem Computer gespeichert werden. Außerdem bestätigen Sie, dass Sie unsere Datenschutzerklärung gelesen und verstanden haben. Wenn Sie nicht einverstanden sind, verlassen Sie die Website. Weitere Information
becki/linux/svn_tips.1238767502.txt.gz · Zuletzt geändert: 2009-04-03 14:05 von becki

Impressum - Datenschutzerklärung