SEDSAT-2 SVN

From SEDSWiki

Jump to: navigation, search

Contents

Access details

Repository address: https://sedsat-2.googlecode.com/svn/trunk/

What is SVN?

SVN is a tool to keep directories of files synchronized across many different peoples computers. The basic idea is that the master copy of all of a projects files are kept on a SVN server, also called a SVN "repository", and each team member downloads or "checks out" a copy of the project files to their own computer. The project files are then accessible like a normal directory of files on each team members computer, and each team member can add/edit files/sub-directories in the main project directory.

After making changes to the project files - eg. adding some PIC functions to the main.c file, or adding some schematics or models in one of the project sub-directories - a team member should make their changes available to the rest of the team. First they need to run the svn "update" command (which updates their copy of the project to the latest - so that they don't over-write someone elses newer version of files with their older copy), and then they run the svn "commit" command, and this uploads their changes to the master SVN repository.

When other team members come online and want to start working on the project, the first thing they should do is run the svn "update" command, which will update the copy of the project files on their computer, with the latest versions on the server. This ensures that they'll pick up the changes that anyone else has made on the project, so that they are working on the most up-to-date version of the project.

One final note: SVN allows you to go back to older versions of the project. Every time any of the team members does a svn "commit", the project release number is incremented. So at any point, if you want to go back and see an older version (or undo a change you or someone else did, including deleting/adding files), you can do an "update" to the specified project release number (either for all files, or just for a specific file) and the appropriate files will be returned to their previous state.

For more information, have a look on Wikipedia, at Revision Control and Subversion.

SVN Setup

You need to do three things. Briefly:

  1. Get an account on the SVN server
  2. Get some SVN software
  3. Set up the SVN software

Create SVN account

We're using google code for hosting the project, so you need a google account. Once you've got this, e-mail me (Steve, in the Comms team) at saxm@dingnet.org.uk and tell me your google account name (ie. foobar@gmail.com) and I'll add you to the project members list, so that you can write to the repository (you can still read/browse the repository without an account).

To access the SVN repository, google uses a different password from your normal google password. To find out what your SVN password is, go to: http://code.google.com/hosting/ and at the top right of the screen, click on "Profile" (you need to be logged in to your Google Account to see "Profile"). Then choose the "Settings" tab. On the settings page, there should be a line saying:

Your googlecode.com password: YouGoogleSVNPasswordHere.

Take a note of the Google SVN password in bold, you'll need it shortly. It is case sensitive.

Get/Configure SVN software

You need some SVN software on your computer to do the check-outs, updates, commits etc... Assuming you're using windows, Tortoise SVN is the recommended SVN client (similar things exist for Linux, Mac etc, contact me if in doubt). It integrates with the windows file explorer quite nicely.

You can download TortoiseSVN from: http://tortoisesvn.net/downloads

Run the installer and it'll install and then you'll need to reboot your computer. Once rebooted, right click on your desktop, you'll see two new menu items "SVN Checkout" and "TortoiseSVN".

As this is the first time using SVN, we need to do a one-time initial "checkout" of the repository. Choose "SVN Checkout". A "Checkout" window will appear. In the "URL of repository" field, enter the google code SVN location:

https://sedsat-2.googlecode.com/svn/trunk/

Figure 1

Now click "OK". A new Checkout window will appear, and a second "Authentication" window should also pop up, asking you for a username and a password. The username is your full google username ie. foobar@gmail.com, and the password is the Google SVN password we go earlier. Tick the "Save authentication" box and click "OK". The authentication window should disappear, and the "Checkout" window should now start showing the progress of downloading the SVN repository. Currently it is less than 5MB in size so shouldn't take too long. Once done, click "OK" to close the Checkout window.

Figure 2

Now on your desktop, a new "sedsat-2" folder will have been created. This is your local copy of the SEDSAT-2 project files. If you go into the directory you can see all the team subdirectories, and within the team subdirectories you have each team files/sub-sub-directories.

Image:003-svn-checked-out.png

SVN Usage

Inside the "sedsat-2" folder that was created during the "Checkout" process above, you'll notice that all the folders initially have green ticks on them. This means that everything from that folder down is in its original state, ie. hasn't been modified since being updated from the repository. If you go into a folder and make a change to a file, the icon for that file, and for all the folders above it, will change to an exclamation mark, to let you know that there has been a change.

If you add some new files into one of the directories, initially they'll have a blue question-mark over their icon. This means that the file is in the project directory, but it hasn't formally been added to the project, so tortoise SVN doesn't know if it should do anything with it - so the file will be ignored by tortoise SVN.

Image:005-svn-adding-new-file.png

To get TortoiseSVN to take notice of the file and to add it to the master SVN repository, you need to right click on the new file after putting it in the project directory, choose "TortoiseSVN" and select "Add". The icon on the new file will now change to a blue plus "+" icon.

Now if you go back to the top-level SEDSAT-2 project directory, you can commit your changes/additions to the master SVN repository, so other people can see your work. Right click inside the sedsat-2 folder and choose "SVN Update". Once this is finished, right click inside the sedsat-2 folder again and choose "SVN Commit".

A "Commit" window will pop up. It will ask you for an (optional) message. This message is for your (and other team members) benefit - just a quick note to let them know what the change you just made was. This is quite a useful thing to have, people can be automatically e-mailed these messages (if they want), so it lets people keep track of what's going on in the project without having to look through the project directory all the time. Please use it! After entering a message, click "OK". The "Commit" window will pop up, after it's done, click "OK".

Image:007-svn-commit-window.png

Typical Usage

Typical usage is as follows.

  1. Decide you want to do some work on SEDSAT-2.
  2. Right click on the sedsat-2 directory and choose "SVN Update".
  3. Open up your application - your PCB design tool, MCU Development environment, Matlab, mechanical modelling package, etc... Create some new files (or open the files already in the sedsat-2 directory) and do some work.
  4. When you're finished working, right click on the sedsat-2 folder again and choose "SVN Commit"

Typical Usage Example (using screenshots)

About to start work, doing a SVN update to update my files to the latest version in the repository, incase any team members have been working on other parts of the project.
I've started editing one of the Java files in the comms directory, adding a new simulate() method.
Finished my changes to SimCore.java. Its icon has turned to an exclamation mark to let me know that I've made changes to it since I got it from the repository (ie. I should probably check it in soon).
I'm comitting my sedsat-2 directory. It reports that changes have been made to one of the Java files (as expected). I should have added a message here...
The commit is done. The repository is now up-to-date with my work, and any other team member who does an "update" will be able to see the changes I made to SimCore.java.
Work done. Repository is clean (Green tick). Time to go to sleep.
Personal tools