Subversion hoidla kasutamisest

Allikas: Kuutõrvaja
Redaktsioon seisuga 20. september 2007, kell 17:29 kasutajalt Jj (arutelu | kaastöö) (Kasutamine)

Subversion ning apache ja dav

Näiteks on masinas suurem hulk kasutajaid kas sooviksid kasutada subversioni samas soovides ligipääsu failidela apache abil mugavalt.

Can I view older revisions?

With an ordinary web browser? In one word: nope. At least, not with mod_dav_svn as your only tool.

Your web browser only speaks ordinary HTTP. That means it only knows how to GET public URLs, which represent the latest versions of files and directories. According to the WebDAV/DeltaV spec, each server defines a private URL syntax for older versions of resources, and that syntax is opaque to clients. To find an older version of a file, a client must follow a specific procedure to “discover” the proper URL; the procedure involves issuing a series of WebDAV PROPFIND requests and understanding DeltaV concepts. This is something your web browser simply can't do.

So to answer the question, one obvious way to see older revisions of files and directories is by passing the --revision argument to the svn list and svn cat commands. To browse old revisions with your web browser, however, you can use third-party software. A good example of this is ViewCVS (http://viewcvs.sourceforge.net/). ViewCVS was originally written to display CVS repositories through the web, and the latest bleeding-edge versions (at the time of writing) are able to understand Subversion repositories as well.


The repository uses a standard layout of:

https://svn.apache.org/repos/asf/xerces/c/
                                       |
                                       | - branches/
                                       |
                                       | - tags/
                                       \
                                         - trunk/


For example, to check out the trunk (the place where the main development is taking place), execute:

svn co https://svn.apache.org/repos/asf/xerces/c/trunk

To check out the code in the xerces-2.7 branch, execute:

svn co https://svn.apache.org/repos/asf/xerces/c/branches/xerces-2.7

To check out the code tagged xerces-2.8.0_rc1, execute:

svn co https://svn.apache.org/repos/asf/xerces/c/tags/xerces-2.8.0_rc1


install freebsd'l

cd /usr/ports/devel/subversion && make WITH_PERL=YES WITH_MOD_DAV_SVN=YES WITHOUT_BDB=YES install clean

httpd.conf vajalikud read

LoadModule dav_module         libexec/apache2/mod_dav.so
LoadModule dav_svn_module     libexec/apache2/mod_dav_svn.so
LoadModule authz_svn_module   libexec/apache2/mod_authz_svn.so


Kasutaja vhost failis peab tööks olema osa

< Location /svn >
DAV svn
SVNParentPath /home/kasutaja/svn
AuthzSVNAccessFile /home/kasutaja/svn.acl.repo
Require valid-user
AuthType Basic
AuthName "Subversion repository"
AuthUserFile /home/kasutaja/svn.acl.www
< /Location >


järgnevad käsud tuleb käivitada kasutajana kes cvs'i kasutama hakkab.


mkdir -p svn
htpasswd -c svn.acl.www kasutaja

Saadud parooli lisame faili


svn.acl.www /home/kasutaja/svn.acl.www

kasutaja:KC9zQCMSI3dDM

svn.acl.repo /home/kasutaja/svn.acl.rep

[test:/]
kasutaja = rw

Anname käsu

svnadmin create test

tekib kaust svn/test

Kui meil on acl lubatud failisüsteemile siis lihtsalt anname käsud.

find . -type d | xargs -n 1 setfacl -m user:www:rwx
find . -type f | xargs -n 1 setfacl -m user:www:rw-


Näide kuidas kasutada: et luua kettale kaust SVN ja seal siis teha checkout, tirime alla kataloogi test, sinna kataloogi test võib tekitada failid ja seejärel scn add failinimi ning selleks, et uploadiks scn commit -message

Kasutamine

Ligi pääseb näiteks veebikaudu

http://minginimi.server.ee/svn/test


svn co svn://sinuaadress/projekt/haru /sinukataloog

Seejärel toimub checkoutimine ja pärast seal sees saad käske kasutada svn update, svn commit

Vajadusel saab samas projektis haru vahetada

svn switch vanaharuaadress uueharuaadress

Enda elu lihtsamaks tegemiseks ,et ei peaks väga pikki käske pidevalt andma

export CVSROOT=:pserver:user@host:/var/cvs
cvs checkout blablaprojekt
cvs up -d -r change_3861
cvs add -kb failinimi //binaarfailid
cvs add failinimi //tavafailid
cvs commit

failide taastamine vanale kujule:

cvs up -j change_9999 -j ver-3_3_3_5 myfile.php

(nb! enne seda peab muudetud fail commititud olema)

Lingid

http://trac.edgewall.org/wiki/TracInstall

exploreri add-on http://tortoisesvn.tigris.org/