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 four sub-directories:
-
trunk— this holds the main development tree, -
tags— this holds archived versions of releases, -
branches— this holds branches that people are working of any of the modules intrunk, -
incubator— this holds work-in-progress modules (mostly language pairs) that have not yet made it intotrunk
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
What is SVN
SVN is a version control system. Linux and Mac users should have it installed already (otherwise, it will be available through your package manager), Windows users should use tortoisesvn (see Using SVN with TortoiseSVN).
Everyone
If you have limited bandwidth or disk space, please see Minimal installation from SVN.
To check out the whole tree:
$ svn co https://apertium.svn.sourceforge.net/svnroot/apertium
Note: The whole tree is over 4GB, 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 https://apertium.svn.sourceforge.net/svnroot/apertium/trunk/<modulename>
So, for example, to check out the Basque-Spanish one, write
$ svn co https://apertium.svn.sourceforge.net/svnroot/apertium/trunk/apertium-eu-es
To perform an update:
$ svn update
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 https://apertium.svn.sourceforge.net/svnroot/apertium/<modulename>
Then cd to the directory you want to import.
$ svn import . https://apertium.svn.sourceforge.net/svnroot/apertium/<modulename>
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.
Committing only part of your changes
If you have changed a number of 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.
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.
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> https://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
Keeping track of new changes
You can keep track of new commits being made through
- email — by signing up at https://lists.sourceforge.net/lists/listinfo/apertium-devel (you may want to make some filters for this, or your inbox will quickly be swamped)
- microblog — by following http://identi.ca/apertium
- IRC — by joining #apertium at freenode.net (messages here come via http://cia.vc/stats/project/apertium)
- RSS feed — by adding https://sourceforge.net/export/rss2_keepsake.php?group_id=143781 to your favorite feed reader
Troubleshooting
502 Bad Gateway Errors
When executing certain operations (such as SVN COPY or branching/tagging, which use SVN COPY), you may get a 502 Bad Gateway error if you used HTTP instead of HTTPS to checkout your working copy. Relocate your working copy to HTTPS and try again. (See this ticket on the Sourceforge trac for more information. See this article for a more detailed explanation as to why this happens.)
$ svn switch --relocate http://apertium.svn.sourceforge.net/ https://apertium.svn.sourceforge.net/
Host not found when using Squid proxy
If you get
svn: OPTIONS of 'http://apertium.svn.sourceforge.net/svnroot/apertium/trunk/lttoolbox': Could not resolve hostname `apertium.svn.sourceforge.net': Host not found (http://apertium.svn.sourceforge.net)
and are using a Squid proxy, add
[global] http-proxy-host=proxyhost http-proxy-port=3128
to the file ~/.subversion/servers
Could not authenticate to server: rejected Basic challenge
This happens because you have checked out with http and not https, you need to switch as follows:
$ svn switch --relocate http://apertium.svn.sourceforge.net/ https://apertium.svn.sourceforge.net/

