logo.png

SUBVERSION
XILINX
DATABASE
GUI
ONLINEV2

Home Up


Contents



1 Introduction

SVN is use to share sources by:

  • boudry
  • gastaldi
  • ggrenier
  • gvouters
  • nroche
  • rcornat
  • combaret
  • muriel

  • Check out sources:
    All:    $ svn co svn+ssh://svn-calice/calice (enter password twice)
    Tagged: $ svn co svn+ssh://svn-calice/calice/online-sw/tags/libLDA-0.0
    Last:   $ svn co svn+ssh://svn-calice/calice/online-sw/trunk/libLDA
    Branche:$ svn co svn+ssh://svn-calice/calice/online-sw/branches/libLDA-SDHCAL-Cern-2011
    

  • Update to last version:
    $ svn update
    $ svn info
    Last Changed Rev: 1828
    

  • Check local modifications:
    $ svn status
    $ svn diff {PATH}
    Last Changed Rev: 1828
    

  • Revert files:
    $ svn revert {PATH}
    

  • Commit changes:
    $ svn add {PATH}
    $ svn commit -m "{TEXT}"
    

  • Update to an older revision:
    $ svn info
    Last Changed Rev: 1828
    $ svn update -r 1800
    

  • Tag a version:
    $ svn cp trunk/libLDA tags/libLDA-0.2
    A         tags/libLDA-0.2
    $ svn commit
    

  • Make a branch:
    svn cp libLDA/ ~/svn/calice/online-sw/branches/libLDA-SDHCAL-Cern-2011
    A         /home/nroche/svn/calice/online-sw/branches/libLDA-SDHCAL-Cern-2011
    $ cd  ~/svn/calice/online-sw/branches/libLDA-SDHCAL-Cern-2011
    $ svn commit -m "Création d'une branche à partir du code \
      se trouvant sur lyosdhcal4 vendredi 23/09/2011 à 10h"
    

  • Erase a bad commit in trunk:
    $ cd trunk/...
    $ svn merge -r 2118:2116 .
    $ svn commit
    $ svn update
    

  • Move a bad commit in trunk to an existing branch:
    $ cd branches/...
    $ svn merge -r 2109:2118 ../../trunk/libLDA
    tf...
    $ diff + cp
    $ svn commit
    $ svn update
    


2 Using svn client


2.1 Using command Lines

$ svn ...

  • $ svn info
  • $ svn status
  • $ svn diff --diff-cmd /usr/bin/diff -x -q
  • $ svn diff
  • $ svn update
  • $ svn revert {PATH}
  • $ svn add {PATH}
  • $ svn del {PATH}
  • $ svn commit -m "{TEXT}"
  • $ svn mv {PATH} {PATH}
  • $ svn mkdir {DIR}
  • $ svn rmdir {DIR}
  • $ svn cp {PATH}
  • $ svn proplist
  • $ svn propget
  • $ svn propset

  • SVN use tags/branches that simply are copies of the main directory.
  • SVN use FSFS BD (recommanded) or Berkley DB.


2.2 Using ``svn-status mode'' under emacs

M-x svn-status

C-h m Display the keys binding
g status update
U update
a add file
A add file recursively
c commit (C-x cc)
m mark file
u unmark file


2.3 Browsing the forge

diff on the forge: https://forge.in2p3.fr/projects/calice/repository/revisions/1609/diff

$ svn diff -r BASE:1606 | diffstat
$ svn diff -r BASE:1606 > myPatch
$ patch -p0 < myPatch   (see man patch)


3 Configuration

There is help here

For read-write access people must create there own key and send the public one. Next we must provide it to Loïc Tortaywith a login and precise it is for Calice project.

Next, we can test the key doing:

$ ssh svn-calice

Here is a link to add building keys (there are english explanations too on the same web site).


3.1 Read Only access

For read-only access send the private key with instructions. Remind that consulation is granted via viewvc.

We need to build the  /.ssh/config file:

Host svn-calice-group svn-calice
        Hostname svn.in2p3.fr
        User calice
        IdentityFile ~/.ssh/id_rsa_group_ro_cvs-in2p3-fr


3.2 Read/Write from personnal account

We need to build the  /.ssh/config file:

Host svn-calice
    Hostname svn.in2p3.fr
    User nroche
    PasswordAuthentication no
    IdentityFile ~/.ssh/svnNRoche_dsa
    IdentitiesOnly yes
    RSAAuthentication yes
    PubkeyAuthentication yes
    ForwardX11 no
    ForwardAgent no

Finaly, we can use SVN:

<< ubuntu
# aptitude install subversion
==
# yum install subversion
>> slc
$ svn co svn+ssh://svn-calice/calice (enter password twice)


3.3 Read/Write from shared calice account

Provide theses files:

$ find /home/calice/Applications/nroche/ -type f
/home/calice/Applications/nroche/etc/ssh_config
/home/calice/Applications/nroche/etc/.ssh/id_rsa_nroche_cvs-in2p3-fr
/home/calice/Applications/nroche/bin/ssh

  •  /Applications/nroche/etc/ssh_config file:
    Host svn-calice
    	Hostname svn.in2p3.fr
    	User nroche
    	IdentityFile ~/Applications/nroche/etc/.ssh/id_rsa_nroche_cvs-in2p3-fr
            IdentitiesOnly yes
    

  •  /Applications/nroche/bin/ssh file:
    #! /bin/sh
    exec /usr/bin/ssh -F $HOME/Applications/nroche/etc/ssh_config "$@"
    

Provide also theses files for confort:

$ find /home/calice/Desktop/outils\ svn/ -type f
/home/calice/Desktop/outils svn/svn_gastaldi.desktop
/home/calice/Desktop/outils svn/svn_nroche.desktop
/home/calice/Desktop/outils svn/README.txt

  •  /Desktop/outils svn/svn_nroche.desktop file:
    [Desktop Entry]
    Version=1.0
    Type=Application
    Terminal=false
    Icon[en_US]=gnome-network-properties
    Name[en_US]=svn terminal nroche
    Exec=sh -c 'cd "$HOME/Sources/calice" && \
    env "PATH=$HOME/Applications/nroche/bin:$PATH" \
    EDITOR=/usr/bin/gedit \
    /usr/bin/gnome-terminal --profile=nroche'
    Name=nroche svn
    Comment=Terminal to issue svn commits for nroche
    Icon=gnome-network-properties
    

Now we can test:

$ PATH=$HOME/Applications/nroche/bin:$PATH
$ ssh -v svn-calice

debug1: Reading configuration data /home/calice/Applications/nroche/etc/ssh_config
debug1: identity file /home/calice/Applications/nroche/etc/.ssh/id_rsa_nroche_cvs-in2p3-fr type -1
debug1: Trying private key: /home/calice/Applications/nroche/etc/.ssh/id_rsa_nroche_cvs-in2p3-fr
Enter passphrase for key '/home/calice/Applications/nroche/etc/.ssh/id_rsa_nroche_cvs-in2p3-fr':

Home Up

This document is also available in PDF and PostScript format.



2015-10-29