Version Control with Subversion

Summary

  1. Update your working directory (to get any recent updates from the server)
  2. Commit your changes when you're done

Basic commands and operations with subversion

Starting work, updating your working copy: before you start work on any file, select the file you're going to work on (or the parent directory) and choose "Update" from the Working Copy menu (or type Command-U). You can also control-click on the file or directory, and select "Update" from the menu that appears. This will apply any changes made in the repository to your working copy.

Committing your changes: when you finish your work for the day, control-click the file you've been working on and choose "Commit" from the menu that appears.

Creating a new file: when you create a new file (for instance, when you start encoding a new text or exhibit), you need to "add" the file to version control so that Subversion knows about it. To do this:

  • create the file in the appropriate directory
  • in the SVN client, control-click on the file and choose "Add" from the menu (or select the file and choose "Add to version control" from the Working Copy menu). You'll see a green plus-sign next to the file, which means it's been added but not committed. Essentially it has been put on a wait list to be sent to the repository if and when you commit.
  • control-click on the file again and choose "Commit" (or type Command-shift-C), send the file to the repository

Deleting a file: if you create a new file and have not yet added it to version control, you can safely delete it from your local system without SVN ever knowing about it. However, if you add a new file to version control and then decide you want to delete it, you have to delete it using the SVN client:

  • in the SVN client, control-click the file and choose "Delete" from the menu. The file will disappear, but you're not done! It still exists in the repository, but has been put on the wait list to be deleted when you commit.
  • control-click on the parent directory (the one that contains the file you deleted) and choose "Commit" from the menu. The reason for this is that since you can't see the deleted file, you can't select it; instead, you have to "commit" the deletion by committing the directory containing the deleted file.

Renaming a file: if you want to rename a file that is under version control, you MUST rename it using the SVN client, or potentially irreconcilable confusion will reign:

  • in the SVN client, control-click the file and choose "Rename" from the menu.
  • control-click on the parent directory (the one that contains the file you renamed) and choose "Commit" from the menu. The reason for this is that "renaming" a file in subversion involves adding a file with the new name, and deleting the old one. You can't see the old version (because it's been deleted already on the local system) so you can't select it; instead, you have to "commit" the deletion by committing the directory containing the deleted file.

About Subversion

Version control is essential to any project that manages large quantities of data over a long period of time. Version control systems do things like:

  • preserve previous versions of files, so that they can be recovered
  • enable multiple users to work on the same file without creating conflicting changes OR at least make it easier to manage conflicting changes
  • prevent users from erasing or damaging each other's work by accident
  • preserve the history of changes that have been made to a file

The WWP uses a tool called "Subversion" (also referred to as "SVN") for this purpose.

All of the encoding computers in the WWP office have working copies of the WWP textbase. When you're encoding a file, always follow this basic procedure:

When you start work for the day, using the SVN client, find your file and "update" it (control-click on the file and choose "Update" from the menu, or type Command-U). This will ensure that if any changes have been made to that file (e.g. by Syd or another encoder), you are working on the most current version. In oXygen, make your changes to the file (transcription, correction, etc.). When you are done working on the file, using the SVN client, "commit" your changes (control-click on the file and choose "Commit" from the menu).