Using SVN
From Apertium
|
Apertium development code is kept in SVN. The following is a basic cheatsheet for using SVN. The SVN repository is arranged into three sub-directory, trunk — this holds the main development tree, tags — this holds archived versions of releases, and branches — this holds branches that people are working of any of the modules in trunk.
If you're new to Apertium and SVN, you probably just want to look at the trunk sub-directory. To browse the tree, you can just go to: raw or ViewSVN
[edit] What is SVN
SVN is a version control system. Linux and Mac users should have it installed already, Windows users should use tortoisesvn (see Using SVN with TortoiseSVN).
[edit] Everyone
If you have limited bandwidth or disk space, please see Minimal installation from SVN.
To check out the whole tree:
$ svn co http://apertium.svn.sourceforge.net/svnroot/apertium
Note: The whole tree is something like 3GB, if you're on a slow connection or have transfer limits, probably it is best to only check out the modules that you need — for a basic installation, the modules "lttoolbox" and "apertium" suffice.
To check out a module:
$ svn co http://apertium.svn.sourceforge.net/svnroot/apertium/trunk/<modulename>
So, for example, to check out the Basque-Spanish one, write
$ svn co http://apertium.svn.sourceforge.net/svnroot/apertium/trunk/apertium-eu-es
To perform an update:
$ svn update
[edit] Developers
To commit your changes (send them to the server):
$ svn commit
Note: Remember to write a nice log message!
To add a file or directory (to an existing module):
$ svn add <file or directory name>
To delete a file or directory from the server:
$ svn delete <file or directory name>
Note: This deletes the file locally aswell!
To import a new module into SVN:
$ svn mkdir http://apertium.svn.sourceforge.net/svnroot/apertium/<modulename>
Then cd to the directory you want to import.
$ svn import . http://apertium.svn.sourceforge.net/svnroot/apertium/<modulename>
[edit] Shortcuts
If you use SVN regularly, it might be worth learning some shortcuts, to save yourself some time.
Instead of svn commit you can use:
$ svn ci
Instead of svn delete, you can use
$ svn rm
If you don't want to wait for your text editor to open when you're committing, you can specify the commit message at the command line:
$ svn ci -m "My commit message"
It's worth noting here that, if you don't understand the shell fully, it's probably better to stick to the text editor.
[edit] Committing only part of your changes
If you have changed a number if files, and don't want to commit everything at once, you can give a list of filenames to svn commit, and only those files will be committed:
$ svn ci file1 file2
Sometimes, it's better to commit this way; to put related changes in the same commit, and keep unrelated changes separate. This makes it easier to undo your changes later, if it turns out there was a problem.
[edit] Undo local changes
If you've made changes that you don't want to keep - and you haven't committed those changes - you can use:
svn revert <file or directory name>
This will reset the files to the last version you fetched from the server.
[edit] Undo all or part of a commit
First work out the revision you want to rollback to (probably the revision that you just committed minus one), cd back to the apertium/ directory.
mv <modulename> <modulename>.new svn co -r <revision> http://apertium.svn.sourceforge.net/svnroot/apertium/<modulename>
Now copy all the files that you want to "revert" from the old revision (<modulename>) back into the new revision (<modulename>.new), then do:
rm -rf <modulename> mv <modulename>.new <modulename> cd <modulename> svn commit

