SPRAAK
|
The SPRAAk code base is stored in a single repository under the control of a vcs (version control system). This provides:
SPRAAK uses Subversion (svn) for this purpose. Subversion is very similar to the popular cvs system, but without the quirks of the latter. Subversion allows for greater flexibility while reorganizing an existing code base. One can move and/or rename files in a subverion repository without breaking it. Something that's not possible in cvs.
The subversion system is primarily a set of command line tools that can be used to create, maintain and generally use repositories. It can be used in several setups varying in complexity from basic (local file access only) to medium (subversion client/server) to advanced (repository hosted via apache extension). For detailed information about subversion, we refer to the project's home-page: http://subversion.tigris.org/
SPRAAK uses the subversion client/server setup in combination with ssh for maximal flexibility. Currently, the repository is stored at ESAT using the spchprog account. The repository is backed-up on a daily base.
To access the repository one uses the svn client program. Only people who have been granted the rights to use the ssh-svn tunnel (see Acquiring access to the code respository) have read and/or write access on the repository.
The basic idea is that all developers have a local working copy of the code in the repository. The svn client program is used to sync and compare this local version with the version in the repository.
This document only describes the most frequently used commands. For a more extensive list of commands you can type
> svn help
For extra help about a specific command type
> svn help <command>
The following command will get the latest SPRAAK code from the repository and place it in the current directory (called workdir from here on):
> svn co svn+ssh://spchprog@spraaksvn.esat.kuleuven.be/users/spraak/spchprog/SPRAAK/repos/trunk .
If you want only a part of the repository, extend the above url with the path of the subtree you're interested in.
Once this command completed, you can go in the workdir directory and use the various svn commands explained in the following sections.
To check the status of the files in the local copy:
> svn status
To view the history for a specific file in the repository:
> svn log foo.c
To view the difference between your local copy and the latest version in the repository:
> svn diff foo.c
To do an atomic check-in of all changes in the current directory (and recursive dirs):
> svn ci -m "Fixed bug 215"
The -m
option allows you to give some comments on the changes. It are these comments that will finally be shown in the history of a file. Try to keep these comments short and useful.
If you only want to check-in some specific files you can add those filenames after the command.
You can add files and directories with:
> svn add bar.c
This will mark those files and directories for addition on the next check-in. They will not be in the repository until you do an explicit check-in. The check-in allows you to add some comments about these new files.
To rename files you can use:
> svn mv foo.c bar.c
This same command can be used to move things around. Again, the actual changes will only happen after an explicit check-in.
The svn client configuration file can be found in $HOME/.subversion/config . In that config file you can specify which file-extensions svn should ignore. It can also be used to set automatically some properties when files are added to the repository for the first time. This is especially usefull to set the svn:keywords
property which is needed if you want to use automatic keyword substitution of for example the Date
, Id
or Author
keyword.
This section is only for internal use at ESAT. At this moment we're not allowing external access to the code repository.
> cd ~/.ssh > ssh-keygen -t dsa -f id_dsa_svn
Give twice an empty passphrase (unless you like to type passphrases alot, or use ssh-agent).
> ssh spraaksvn.esat.kuleuven.be
> exit
Host spraaksvn IdentityFile ~/.ssh/id_dsa_svn ForwardAgent no ForwardX11 no IdentitiesOnly yes BatchMode yes
command="/usr/bin/svnserve -t --tunnel-user=<your-accountname>"
command="/usr/bin/svnserve -t --tunnel-user=johndoe" ssh-dss AAA...AGQdQ== johndoe-svn@spraaksvn
$ svn co svn+ssh://spchprog@spraaksvn.esat.kuleuven.be/users/spraak/spchprog/SPRAAK/testrepos
$ cd testrepos/test/trunk
$ svn statusThis should show that the file x.c was modified.
$ svn commit x.c -m "Comment for the modification"
$ svn log x.cThis should show a history of changes, including the author of those changes.