Some pointers about the subversion (svn) tool

From Planets
Revision as of 09:18, 30 October 2023 by Emillour (talk | contribs)

Jump to: navigation, search

The subversion (a.k.a svn) tool

The subversion (svn) tool is what is used to keep track of the various versions of the PCM source codes. Quite similar to the also well known git tool.

Some useful svn commands

TODO: Put some examples here of using ... checkout ... update ... status ... diff

For experts: how to commit your changes

IMPORTANT: This only concerns you if you are included in the core team of developers with commit privileges.

  1. You must be online (committing requires to connect and interact with the svn server)
  2. You must have made you changes on (svn) versioned code, and that it is up-to-date with the repository ("svn update" is your friend).
  3. It is recommended that you have set your SVN_EDITOR environment variable to point to your favorite text editor. For instance "vi":
declare -x SVN_EDITOR=vim

Now that things are ready for the commit (you might want to check one last time with "svn diff" that all your changes are in place and that you cleaned up any intermediate stuff), you can, in the directory where you made the changes, run the command:

svn commit

Note that if you want to only commit some files and not all those you modified in the current directory and subdirectories, you can can specify explicitely the paths&names of files to commit as extra arguments to "svn commit"

Once the "svn commit" command launched, your editor will open up, pre-filled with the differences in the code implied by your changes automatically inserted. All you need to do is fill in the first part of the message with comments about your changes (e.g. bug fix of ... , added feature as ..., code tidying, etc.). usually a few lines suffice. It is common practice to state in the first line of the commit which PCM is concerned ("Mars PCM", "Generic PCM", "Venus PCM", ...) and to sign the commit with your initials. Once you have entered your message, just save the file and this will automatically trigger the commit.

Once the commit triggered, you will need to specify you svn account login and password, at least the first time (svn can save and store these so that you don't need to enter them every time).

Some typical svn errors you may run into

If when trying t use an svn command you get a message of the likes of:

svn: E155036: The working copy at ....
is too old (format 29) to work with client version '1.10.2 (r1835932)' (expects format 31). You need to upgrade the working copy first.

This simply means that your svn tool has been upgraded to a more recent version and that you need to upgrade your current repository to follow up. In order to do that simply do

svn upgrade

And then you can keep using svn as before.