====== SubVersion ======
===== Links =====
* [[http://subversion.apache.org/ | SVN Project website ]]
* SVN Book [[http://svnbook.opensys.pl/ | PL ]] [[ http://svnbook.red-bean.com/ | ENG ]]
* [[ http://svn.asic.fis.agh.edu.pl/ ]]
===== SVNShell & SmartSVN =====
{{:svn:svnshell.tar| SVNShell_script}} **DO NOT USE -- OLD**\\
{{:svn:smartsvn.tar| SmartSVN_script}} **DO NOT USE -- OLD**\\
Download, untar (''tar -xf name.tar'') and add to ''$PATH''.
===== Administrators =====
* SVN administrators : **Kuba Moron**, **Szymon Kulis**
* People who can help : **Krzysztof Swientek**
===== Using SVN =====
==== Help ====
It goes without saying that this book exists to be a source of information and assistance for Subversion users new and old. Conveniently, though, the Subversion command-line is self-documenting, alleviating the need to grab a book off the shelf (wooden, virtual, or otherwise). The svn help command is your gateway to that built-in documentation:
$ svn help
==== Starting svn shell ====
Before you start using svn you have to start **svnshell**. The main function of this script is to simplify key management, you will be asked only once to enter yours pass-phrase at script startup (if you don't like this script you may configure your ssh client in different way). Script is pre-installed on all production servers (koi, ibm). To start shell, just type:
svnshell
You should see modified prompt :
[SVN] promt$
**Notes:**
* script assumes existence of public/private-key named **svn** and **svn.pub** in yours **.ssh** directory (''.ssh/svn'' and ''.ssh/svn.pub'')
* script doesn't have any significant dependencies you may copy it to you workstation and use it
* script source is in ''svn : cds_etc/trunk/etc/svn_scripts/svnshell''
==== Getting repository ====
To get local copy of repository :
svn checkout svn+ssh://svn@asic.fis.agh.edu.pl/REPOSITORY_NAME
or optionally
svn checkout svn+ssh://svn@asic.fis.agh.edu.pl/REPOSITORY_NAME/trunk REPOSITORY_NAME
==== Update ====
To download most recent version form repository use:
svn update
==== Commit ====
To commit (send to server) yours changes use:
svn commit
You may also add specific resource to be added:
svn commit dir/filename
In addition you may provide commit comment from command line using **-m** option:
svn commit -m "comment to my commit"
==== Adding ====
To add new resource (file / directory) use:
svn add file
**NOTE:** Be careful, adding directory means adding directory itself and all files inside it.
To add **only directory** without files inside you need to:
svn add -N dirname
==== Deleting ====
To remove resource (file / directory) use:
svn del file
==== Working with Cadence ====
In order to simplify process of adding new resources created during work with Cadence an helper script **smartsvn.py** was prepared.
The main aim of this script is to scan over directory tree and look for new cells / views to be added to repository.
To run script use:
smartsvn.py
==== How to revert to a previous revision ====
- make sure that you haven't made any changes to you repository. If you changed something, it will cause problems. The easies way is to rm ./*
svn update
- use this command to see what is going to be changed when you go from current revision to **NNN** revision of **dir** svn merge -rHEAD:NNN dir
- if you like action proposed by previous command, just remove **--dry-run** to revert: svn merge --dry-run -rHEAD:NNN dir
- real life example cd AMS400/EUDET_VI_AMS/
svn merge -rHEAD:128 .
===== Setting up svn =====
==== getting access to svn server ====
Access to repository is granted based on public/private-key authorization mechanism.
You need to generate ssh key pair:
ssh-keygen -t rsa -b 2048 -f ~/.ssh/svn
Send generated **PUBLIC KEY (~/.ssh/svn.pub)** to SVN Administrator.
==== setting environment ====
SVN utilizes one of system editors to allow entering commit comments in interactive mode.
Editor to be invoked is specified by environmental variable SVN_EDITOR. To change
default editor you should set this variable in yours ''~/.bashrc'' file, e.g:
export SVN_EDITOR=gvim
===== typical use case =====
- going into repository directory cd YOUR_REPO
- getting latest versionsvn update
- **work very hard**
- work ending
* getting latest version (someone **may changed something while you were working on Yours local copy of data**) svn update
* if there are were any changes You **should check if Your work is compatible** with changes commited by someone
* if You created any new files (cells, schematics, layouts, ...) You should **add them to repository** smartsvn.py
* at the end You have to **send changes to repository** svn commit
**You should put (not to long, but having sense) comment **
===== FAQ =====
==== rename cell ====
* if You rename cell A to cell B under CADANCE, you have to :
- ''svn update''
- ''svn del A''
- ''svn_helper.py del_svn_info B''
- ''svn_helper.py add B''
==== switching to new access method ====
$cd YOUR_REPO
$ svn info
Path: .
URL: http://svn.lumifun.ftj.agh.edu.pl/YOUR_REPO
Repository Root: http://svn.lumifun.ftj.agh.edu.pl/YOUR_REPO
Repository UUID: ...
Revision: ...
Node Kind: directory
Schedule: normal
Last Changed Author: ...
Last Changed Rev: ...
Last Changed Date: ...
$svn switch --relocate http://svn.lumifun.ftj.agh.edu.pl/YOUR_REPO svn+ssh://svn@asic.fis.agh.edu.pl/YOUR_REPO .
Example
$cd ~/IBM013/EUDET_VI_IBM
$ svn info
Ścieżka: .
URL: http://svn.lumifun.ftj.agh.edu.pl/EUDET_VI_IBM/tunk
Katalog główny repozytorium: http://svn.lumifun.ftj.agh.edu.pl/EUDET_VI_IBM
UUID repozytorium: 134063e6-8b79-43c4-80ea-df54b304f938
Wersja: 789
Rodzaj obiektu: katalog
Zlecenie: normalne
Autor ostatniej zmiany: przyboro
Ostatnio zmieniona wersja: 789
Data ostatniej zmiany: 2012-05-18 15:57:54 +0200 (pią)
$svn sw --relocate http://svn.lumifun.ftj.agh.edu.pl/EUDET_VI_IBM/trunk svn+ssh://svn@asic.fis.agh.edu.pl/EUDET_VI_IBM/trunk .
$ svn info
Ścieżka: .
URL: svn+ssh://svn@asic.fis.agh.edu.pl/EUDET_VI_IBM/trunk
Katalog główny repozytorium: svn+ssh://svn@asic.fis.agh.edu.pl/EUDET_VI_IBM
UUID repozytorium: 134063e6-8b79-43c4-80ea-df54b304f938
Wersja: 789
Rodzaj obiektu: katalog
Zlecenie: normalne
Autor ostatniej zmiany: przyboro
Ostatnio zmieniona wersja: 789
Data ostatniej zmiany: 2012-05-18 15:57:54 +0200 (pią)
===== Relocate to asic =====
To relocate **YOUR_REPO** from lumifun to asic please follow the instructions given below:
- Go to **YOUR_REPO** directory $ cd path_to_YOUR_REPO
- Check current URL **(third line below between > and <)**$ svn info
Path: .
URL: >>> svn+ssh://svn@lumifun.ftj.agh.edu.pl/YOUR_REPO <<<
Repository Root: svn+ssh://svn@lumifun.ftj.agh.edu.pl/YOUR_REPO
Repository UUID: a855ac54-1f2a-4fde-b2df-7ae56cbf9e90
Revision: 107
Node Kind: directory
Schedule: normal
Last Changed Author: someone
Last Changed Rev: 1
Last Changed Date: 2014-02-08 17:47:30 +0100 (Sat, 08 Feb 2014)
- Run svnshell
- Copy current URL (between > and < above) and perform command:
$ svn sw --relocate CURRENT_URL_FROM_SVN_INFO svn+ssh://svn@asic.fis.agh.edu.pl/YOUR_REPO
===== Windows =====
- Install putty using installer (http://www.chiark.greenend.org.uk/~sgtatham/putty/download.html)
- Use **puttygen.exe** to generate keys
- enter ** PASSPHRASE **
- change key lenght to **2048 RSA**
- move mouse during key generation
- after generation **save keys to disk** (both private and public)
- **send** public key to SVN administrator
- Open putty
- go to Session -> Connection -> SSH -> Auth
- click the "Browse..." button and select the ppk file that you just saved using PuTTYgen
- now return to the "Session" category
* enter hostname : **lumifun.ftj.agh.edu.pl**
* saved sessions : **lumifun**
* clic **save**
- Open TortoiseSVN -> Settings
* Select the **Network configuration** and point the SSH client to **TortoisePlink.exe** (location where you installed Tortoise)
- Use svn, ass a path to repository use svn+ssh://svn@asic.fis.agh.edu.pl/REPO_NAME
- To avoid entering passphrase each time you need:
* run **pageant.exe** (putty instalation directory)
* click on your private key to unlock it
* You need to do it after each reboot