Common operations
-
export SVNUSR=svn+ssh://svn.cern.ch/reps/atlasusr/sevilla
- Creating a directory:
-
svn mkdir $SVNUSR/ADirectory -m "create"
- Deleting a directory:
-
svn rm share
-
svn ci -m "delete share directory"
- Importing a package:
-
svn import . $SVNOFF/Path/To/Package/trunk -m "initial import"
Configuration
The trick is to have the RSA2 key generated, and added to the ssh-agent to avoid typing the passphrase every time:
ssh-add ~/.ssh/id_rsa
Summary of useful SVN commands
The following notations are used:
$SVNROOT |
The URL of the ATLAS SVN repository |
D , E |
A directory |
P |
A CMT package (corresponding to [<path-to-package>/]<package> in the above examples |
T |
A tag |
B |
A branch root (by convention, terminating in -branch ) |
F , G |
A file in the package |
The ATLAS organization of the
SVN repository is:
- The package name
P
may contain the full path to the package (e.g. MyTopLevelDir/MyDirectory/MyPackage
)
- The main trunk for each package is stored in
$SVNROOT/P/trunk
- Tagged versions are stored for each package in
$SVNROOT/P/tags/T
- Branches are stored for each package in
$SVNROOT/P/branches/B
To figure out quickly (semantically or syntatically) a svn command use
svn help command
, e.g., svn help status, or svn help log.
Action |
SVN command |
Create a repository into D |
svnadmin create D |
Import package P |
svn import . $SVNROOT/P/trunk |
Check out main trunk |
svn co $SVNROOT/P/trunk P |
Check for changes |
svn status -u |
Check in all changes |
svn ci -m "message" |
Check in a file F |
svn ci -m "message" F |
Check out a tag T |
svn co $SVNROOT/P/tags/T P |
Check out directory D |
svn co -N $SVNROOT/P/trunk/D |
Clear conflict status |
svn resolved file |
Update local copy to HEAD |
svn update |
Remove local changes |
svn revert |
Switch to a tag T |
svn switch $SVNROOT/P/tags/T |
Switch to HEAD |
svn switch $SVNROOT/P/trunk |
Rename a file |
svn mv F G |
Rename a directory |
svn mv D E |
Copy a file/dir |
svn copy F/D G/E |
Add a file |
svn add name |
Remove a file |
svn remove name |
View log |
svn log |
List tags on package |
svn ls $SVNROOT/P/tags |
Convert tag to SVN revision |
svn log -v --stop-on-copy $SVNROOT/P/tags/T |
Check history |
svn log |
Tag to T |
svn cp . $SVNROOT/P/tags/T |
Remote tag to T |
svn cp $SVNROOT/P/trunk $SVNROOT/P/tags/T |
Get all tags |
svn ls $SVNROOT/P/tags |
Do a diff |
svn diff [-r rev1:rev2] [file] |
Do a diff from package top dir |
svn diff --old=$SVNROOT/P/tags/tag1 --new= . [file] |
Do a remote diff |
svn diff $SVNROOT/P/tags/tag1 $SVNROOT/P/tags/tag2 |
Revert changes to a file |
svn revert file |
Links
--
SergioGonzalez - 2016-08-29