
|
anglais seulement |
EPFL
>
ENAC
>
IIE
>
Distributed Intel... > Resources > Computing at DISAL > Programming > Subversion (SVN) |
|
Resources Robots
Sensor Networks Computing at DISAL disal.epfl.ch Latex Programming Backup Printing Graphic Templates Directions Hardware Design
Programming
|
Subversion (SVN)Subversion is a version control system and a compelling replacement for CVS. It keeps track of changes and is an excellent utility for synchronizing files between computers. Using Subversion on Linux, Mac OS X or other Unix systemsOn many Linux distributions, you can install the SVN package via the package management system. SVN for Mac OS X is distributed via Fink or Darwinport. There is also a DMG package available on subversion.tigris.org. For RedHat, you can download an RPM package from subversion.tigris.org and install this. Note that this package depends on libneon and APR. Building from the source files also works well and is sometimes easier than finding the right RPMs (if you are working on a system using RPM), especially if you need SSL support. To install SVN with SSL support on the internal RedHat machines, follow the instructions in /net/lanospc40/export/UTILS/subversion-svn-ssl-install/README on your machine. The easiest way to use SVN is from the command line. The most important commands are: svn checkout http://server/path/to/repository Using Subversion on WindowsDownload and install SVN from subversion.tigris.org, as well as Toirtoise SVN from tortoisesvn.tigris.org.
Most subversion commands can then be reached via right-click in Windows Explorer or on the desktop. Useful Subversion CommandsMoving and copying files in an SVN tree
In principle, the standard Unix mv and cp can be used to move or copy files, followed by adding the new file to the repository (and removing the old file in the case of mv). However, SVN has its own mv and cp commands: svn mv my-old-file my-new-file These commands will not only automatically add the new file to the SVN tree (and remove the old one in the case of mv) but also store the information that the new file has been derived from the old one. Note that sourceforge (sf.net) does not allow svn cp and svn mv, and files in such repositories have to be copied with the Unix commands and added/removed manually. Moving a repository
If you move your repository to another location, you can modify the repository path of your working copy by typing svn switch --relocate http://oldserver/oldpath http://newserver/newpath Excluding/ignoring files
You can exclude files (e.g. *.o) from a directory by typing (in this directory): svn propset svn:ignore *.o To show the ignored files, type: svn status --no-ignore Administration: flattening a repository (removing versions)
If Subversion is mainly used for synchronization purposes, it might be good to remove old versions from time to time, and just keep the newest revision. This can be done in three steps. First, dump the head revision using: svnadmin dump REPOSITORY -r HEAD > temp.svndump Second, create a new repository, and third, import the dump in this new repository using: svnadmin import NEWREPOSITORY < temp.svndump The old repository can then be deleted (or better: keep it for a couple of days to be sure everything went right). Subversion CaveatsFilenames containing :, /, \, ...
Files containing the characters :, /, \ (and some others) will cause checkout/update to fail on Windows, because Windows doesn't allow such characters in filenames. Filenames with accents or umlauts
On some systems, SVN will show the error "Can't recode string" when checking out a file with an accent or an umlaut. To solve this problem, set the following environment variable: set LANG=en_US.UTF-8 |
|
|
Site map © 2010 EPFL , ENAC IIE DISAL, Station 2, CH-1015 Lausanne, tel. +41 21 693 12 96 gregory.mermoud@epfl.ch |