The SVN url has been changed by SourceForge. In your repository root, or in an individual module, run the command:
svn switch --relocate

Using SVN

From Apertium
(Redirected from SVN)
Jump to: navigation, search


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,
  • builds — holds binary releases (of packages not suited for our normal Sourceforge file releases downloads),
  • tags — this holds archived versions of releases,
  • branches — this holds branches that people are working of any of the modules in trunk,
  • incubator, nursery, staging — these hold work-in-progress modules (mostly language pairs) that have not yet made it into 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 (otherwise, it will be available through your package manager), 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 apertium

Note: The whole tree is over 8GB, 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[1].

To check out a module:

$ svn co<modulename>

So, for example, to check out the Basque-Spanish one, write

$ svn co

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<subrepository>/<modulename>

Then cd to the directory you want to import.

$ svn import .<subrepository>//<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 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.

[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><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

[edit] Keeping track of new changes

You can keep track of new commits being made through

[edit] Troubleshooting

[edit] 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

[edit] Host not found when using Squid proxy

If you get

svn: OPTIONS of '':
	 Could not resolve hostname `': Host not found (

and are using a Squid proxy, add


to the file ~/.subversion/servers.

SVN is picky about the format of this file. Make sure you don't have e.g. spaces in front of the lines, you'll get svn: ~/.subversion/servers:144: Option expected.

[edit] 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
  1. (Developers) As an alternative to checking out particular modules as separate working directories consider the sparce directories feature of svn
Personal tools