SVNShell_script DO NOT USE – OLD
SmartSVN_script DO NOT USE – OLD
Download, untar (tar -xf name.tar
) and add to $PATH
.
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
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:
.ssh/svn
and .ssh/svn.pub
)svn : cds_etc/trunk/etc/svn_scripts/svnshell
To get local copy of repository :
svn checkout svn+ssh://[email protected]/REPOSITORY_NAME
or optionally
svn checkout svn+ssh://[email protected]/REPOSITORY_NAME/trunk REPOSITORY_NAME
To download most recent version form repository use:
svn update
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"
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
To remove resource (file / directory) use:
svn del file
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
rm ./* svn update
svn merge -rHEAD:NNN dir
svn merge --dry-run -rHEAD:NNN dir
cd AMS400/EUDET_VI_AMS/ svn merge -rHEAD:128 .
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.
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
cd YOUR_REPO
svn update
svn update
smartsvn.py
svn commit
You should put (not to long, but having sense) comment
svn update
svn del A
svn_helper.py del_svn_info B
svn_helper.py add B
$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://[email protected]/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://[email protected]/EUDET_VI_IBM/trunk . $ svn info Ścieżka: . URL: svn+ssh://[email protected]/EUDET_VI_IBM/trunk Katalog główny repozytorium: svn+ssh://[email protected]/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ą)
To relocate YOUR_REPO from lumifun to asic please follow the instructions given below:
$ cd path_to_YOUR_REPO
$ svn info Path: . URL: >>> svn+ssh://[email protected]/YOUR_REPO <<< Repository Root: svn+ssh://[email protected]/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)
$ svn sw --relocate CURRENT_URL_FROM_SVN_INFO svn+ssh://[email protected]/YOUR_REPO
svn+ssh://[email protected]/REPO_NAME