Subversion Guide

If you are interested in using SVN to access or edit the Ingres repository you will find a quick user guide here to get you started. To explore some of the more advanced features of SVN, we recommend Version Control with Subversion.

Server and Structure of the Repository

The SVN repository is located at http://code.ingres.com/ingres and the root directory has the following three folders:

main - Location of the main working copy of the Ingres code, sometimes referred to as trunk
tags - Location of releases
branches - Location of working copies, branched off main or a tag

Our server is running SVN version 1.4.2 so it is highly recommended you use that version or newer. If you do not have SVN installed it is available at http://subversion.tigris.org/. For the rest of this guide we will assume you are working with main, checked out to /devsrc/ingres-main, and using command line SVN. If you are interested in using Eclipse, you will need the Subclipse plugin, for more information please refer to SubclipseGuide.

Creating and Maintaining a Workspace

Creating a new workspace is quite simple using SVN. The basic syntax is as follows:

svn {co|checkout} {RepositoryURL} [WorkspaceDirectory]

Let us assume you are creating a workspace of the main line, and you want to create your workspace in /devsrc/ingres-main, then you would enter the following command:

svn co http://code.ingres.com/ingres/main /devsrc/ingres-main

Wait while the client pulls the repository from the server and sets up your workspace, this should not take longer than a few minutes, depending on your connection speed. Once completed you can now browse, edit, and build your source code. It is always possible that somebody has edited a file and committed the change to the repository since you checked out the source. Before you start editing a file you should run:

svn update [file|dir]

This will check your revision against the repository and download any updates committed, that way you will always work on the most up to date code. Running svn update will update all files recursively from your current directory, in fact all commands run through svn will act recursively on all sub directories.

svn status [file|dir] will show you changes you have made but not yet committed to the repository. Typing this command at the root of your workspace will show all changes made throughout the whole project.

Basic Editing and Submitting

If you have made changes to a file, ensured that Ingres compiles and you are ready to submit the change issue the following command:

svn commit [file|dir] -m "Trac ticket prepended with #"

Please note that we'll be enforcing a valid ticket and code approval prior to allowing changes.

For example, you edited /devsrc/ingres-main/src/back/dmf/dmf/dmfcpp.c, and now wanted to submit the changes you could just run the command:

svn commit /devsrc/ingres-main/src/back/dmf/dmf/dmfcpp.c -m "#45 fixed" --username biff

Alternatively if you had edited several files in that directory:

svn commit /devsrc/ingres-main/src/back/dmf/dmf -m "#48 and #45 fixed" --username biff

Also remember SVN checks all sub directories recursively and also if you leave out the path, it will use the current directory as default.

If during your work you created a new file, you will have to add this to the SVN project, otherwise it will not be recognized when you commit your changes. To do this you use:

svn add {file}

So for example if you created a new file in /devsrc/ingres-main/src called new_file.c, you would have to run:

svn add /devsrc/ingres-main/src/new_file.c

Now when you commit your changes it will also add this new file to the repository. The same logic applies to removing files, however do not remove a file using the rm utility. Instead use:

svn remove {file}

For example you realize the file new_file.c that you recently is unnecessary, you would run:

svn remove /devsrc/ingres-main/src/new_file.c

To undo any changes that you have made, and restore the file to the current revision of the repository, use:

svn revert {file}

To rename or move a file within the project, do not use the mv utility, instead use:

svn move {SOURCE} {DESTINATION}

End Notes

SVN has a lot more functionality than presented in this Wiki. If you are interested in learning some of the more advanced topics when it comes to SVN, we recommend Version Control with Subversion. Also to get command line help you can run svn help for a list of commands and svn help {command} to receive help on a specific command.