SVN HOWTO

Following this link you can browse the SVN repository: svn repository

full svn doc

user tasks

checkout (from this point, follow the svn-book)

download this script and use it: svn-co "nome_progetto"

remote, via ssh:

svn co svn+ssh://ginevra/home/svn/<project>/trunk <working dir name>

local:

svn checkout file:///home/svn/<project>/trunk <working dir name>

creating repositories

Go to server machine. As user on the server machine (is it possible from remote?), create a repos for your "project"

newgrp svn && umask 002 && svnadmin create /home/svn/<project name>
and then import the "project" from your machine
svn import <path-to-project> file:///home/svn/<project name> -m"Initial import"
or from a remote site:
svn import <path-to-project> svn+ssh://<server>/home/svn/<project name> -m"Initial import"

merging

Merging different revs (e.g. to report modifications made in trunk in another branch). Example: we are in the branch ecmwf. Last modification is rev 378 (svn info). The present rev of trunk is 389. The command

svn merge -r 378:389 <path_to_repos>/trunk
merges modifications made from 378 to 389 and writes them in the present directory (the ecmwf branch).

merging HOWTO

Procedura per allineare un branch con il trunk. Da eseguire regolarmente per evitare drift troppo ampi delle due versioni

  1. posizionarsi nella directory del branch
  2. eseguire
    svn update
  3. per individuare la revisione di distacco, eseguire:
    svn log -v | grep trunk | head -1
    il risultato è (esempio):
       A /branches/dust (from /trunk:259)
    e quindi la revisione di distacco è 259
  4. per individuare l'ultima revisione del trunk, eseguire:
    svn info | grep Revision
  5. per controllo, eseguire:
    svn merge --dry-run -r <rev distacco>:<ultima rev> svn+ssh://ginevra/home/svn/bolchem_V-2/trunk
  6. per controllo dei files in conflitto: eseguire
    svn merge --dry-run -r <rev distacco>:<ultima rev> svn+ssh://ginevra/home/svn/bolchem_V-2/trunk | egrep "^C" 
  7. per rendere effettive le modifiche nel branch, eseguire:
    svn merge -r <rev distacco>:<ultima rev> svn+ssh://ginevra/home/svn/bolchem_V-2/trunk
  8. risolvere gli eventuali conflitti
    1. individuare il file in conflitto
    2. andare su websvn
    3. cercare nel trunk il file (cliccandoci sopra finoa vedere il listato)
    4. cliccare su blame
      questo fa vedere per ogni riga del file, in quale revisione è stata inserita e quale utente l'ha inserita
  9. verificare il funzionamento (compilazione, run, ...)
  10. eseguire il commit del branch

Quando si deve chiudere il branch, si esegue la procedura e poi ...

risoluzione conflitti

admin tasks

apt-get install subversion subversion-tools websvn

configuring websvn

dpkg-reconfigure websvn

creating repository base

create the "parent" directory (not an svn repos, just the "container" where user with permission can create repositories)

mkdir /home/svn

grant permissions

(see http://www.debian-administration.org/articles/374#comment_1)

chgrp -R svn /home/svn/
chmod -R g+w /home/svn/
chmod -R g+s /home/svn/
addgroup svn
addgroup alberto svn

renaming repository

just rename the directory on the server (http://svn.haxx.se/users/archive-2006-09/1139.shtml)