SEDSAT-2 SVN
From SEDSWiki
Contents |
Access details
Repository address: http://svn2.assembla.com/svn/SEDSAT-2
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.
After making changes to the project files - eg. adding some datasheets or modifying some program code - a team member probably wants to make their changes available to the rest of the team, so they firstly run the svn "update" command, and then they run the svn "commit" command, and this uploads their changes to the master SVN repository.
What about other team members? How do they update the copy of the project files on their machine, with the latest copy in the SVN respository? They use the SVN "update" command on its own, and this synchronizes the files on their machine with those in the repository.
For more information, have a look on Wikipedia, at Revision Control and Subversion.
Other uses
Another possible use for SVN is for keeping your own files up-to-date between two different machines. Perhaps you normally work on SEDSAT-2 in your room on your own computer, but you need to use your university computers to do some work (eg. using Matlab or on a schematic capture program which your university has installed). You could just use SVN to download the SEDSAT-2 project onto your computer at university, then you do your SEDSAT-2 work as normal. Just do a SVN "commit" before going home, and when you get home, all the changes you made in the repository whilst at university can be replicated on your own computers copy of the repository, just by doing a SVN "update".
How do I use SVN?
Before beginning to do some work, make sure your own copy of the SEDSAT-2 repository is up-to-date with the master copy held on the SVN server. You do this by using the SVN "update" command.
After you've finished your block of work and want to make your changes accessible to everyone else in the SEDSAT-2 project, use the SVN "update" and then SVN "commit" commands to upload your changes to the SVN server.
What if I break something?
Don't worry, SVN keeps a backup of all files every time any changes are made! So if you accidentally make a mistake or delete some files, then it doesn't matter as you/we can just do a SVN roll-back, which lets us roll the SVN database back to any point in the past, and all the files in the repository will then be as they were at that point in time. Or if the damage isn't that severe, we can reverse individual changes.
How do I set up SVN?
You need to do three things. Briefly:
- Get an account on the SVN server
- Get some SVN software
- Set up the SVN software
Creating an SVN account
First, you need to create yourself an account on the SVN server. I've chosen a free SVN provider, assembla, and this should be fine just to allow us to get a feel for subversion. Go here to register:
https://www.assembla.com/user/signup
After registering, you don't need to use the assembla website anymore, just remember your username and password.
Get SmartSVN software
Next, you need to set up a SVN client on your computer. SmartSVN is reasonable and is Java based, so should be usable by everyone in SEDSAT-2 regardless of whether they run Windows, MacOSX, Linux or anything else.
Get SmartSVN from here:
http://www.syntevo.com/smartsvn/download.html
Download this and then run it.
Setting up SmartSVN
The first time you run SmartSVN, you'll need to scroll to the bottom of the license agreement and click that you accept the terms and conditions. After clicking "next", make sure the "Foundation version" is selected. Then click "finished".
You may get a message about importing "Repository Profiles" or something, if you do just click "Cancel", if you don't then don't worry about it.
Now to set up the SEDSAT-2 repository, your SmartSVN should look like this:
Make sure "Check out project from repository" is selected, and click "ok".
Now, select "Quick checkout" and enter the following SEDSAT-2 Subversion repository URL into the "URL" field:
http://svn2.assembla.com/svn/SEDSAT-2
And then choose where, on your computer, you want to keep your copy of the SEDSAT-2 project files. I've put them on my Desktop, but you can put them wherever you want. Your screen should look something like this:
Now click "next" and then on the final screen, click "Finish".
At this point, SmartSVN will start downloading a copy of the current SEDSAT-2 design database to your computer. After this is done (it may take a while - the design database is currently 56Megs and growing!), you should see the current list of SEDSAT-2 project files in the main SmartSVN window, like this:
The SmartSVN window on the left is just the list of directories in the repository, and the files on the right are all the files in the repository. The first thing to do is to right click in some of the whitespace in the list-of-directories window on the left, and make sure that the "Files from subdirectories" checkbox is unselected (if it isn't then unselect it).
Using SmartSVN
SmartSVN itself is only used to synchronize the copy of the SEDSAT-2 project files on your computer, with the master copy in the SVN database. So if you are doing actual work for SEDSAT-2, you can ignore SmartSVN for most of the time. All you need to do is make sure you are working on the most up-to-date copy of the project. This involves:
- When you start working, use the SVN "update" command to make sure your files are up-to-date - maybe one of your team members have made some changes to some files, you will probably want to work with their latest copy these files rather than the now out-of-date files on your computer.
- When you are ready to make your changes public, use the SVN "update" command followed by the SVN "commit" command, to write your changes to the repository.
Adding files to the repository
Lets say you have just created a new file, perhaps a matlab program, to calculate the amount of energy you will get per orbit from the solar cells. For example, a file called "energy_per_orbit.m", in the directory "SEDSAT-2\power\matlab\". You need to tell SmartSVN which files should be added to the repository, and which shouldn't (perhaps because they are temporary files/temporary compiler output etc, which we don't want to clutter the repository with). So you go to SmartSVN and click "refresh", the second icon from the top left. It should pick up the new files and a small red arrow will appear next to directories that have changed, in the SmartSVN directory view. Navigate through the directory list to the directory power\matlab\, and in the main file-list window of SmartSVN, you should see the new file energy_per_orbit.m. There will be a small blue star next to the icon for this file - this means that the file hasn't been added to the SVN repository. Right click on the file and select "Add". Next time you do a update/commit, this file will be added to the SVN master database.
Example usage
Let us say, for example, that you wanted to make a change to the file comm/edit_this_file_and_say_hi.txt. You can forget about SVN for a minute - close or minimize SmartSVN, if you like.
Now find the project files on your local machine, for me they are on my desktop, in a folder called SEDSAT-2. Go to this folder (or wherever you checked-out the repository to on your own computer), then go into the "comm" folder. In "comm" you'll find the file "edit_this_file_and_say_hi.txt". Edit this file using eg. notepad, add a message, then save it and close notepad.
Now go back to SmartSVN and click "Refresh" (second icon from the left at the top). The "Local state" column for the file "edit_this_file...." should now say "modified". Click on "commit" and click on "next". You can now add a comment associated with the change you made. At the moment there's not much to say, so I haven't bothered with adding comments, but you are welcome to add one.
Click "finish" and you'll be prompted for the username and password you registered on the assembla website earlier on. After entering these details and clicking "OK", the changes should be uploaded to the SEDSAT-2 Subversion repository, and in SmartSVN you should see that the version number of the file has now increased by one.
Next time you want to do some work, start by clicking on "update" in SmartSVN to make sure that you update your copy of the design database with all the changes made by everyone else. SmartSVN will ask you whether you want to update to "HEAD" (this means the latest version), or whether you want to choose a specific (older?) version. Choose "HEAD", for now at least.
Houston, we have a problem.
You can try contacting Steve in Comms, either by e-mail or by Yahoo IM (username: steve_m46). He will be happy to help.
Internet through a proxy?
What if your internet access is through a proxy server? If that is the case, then after following the above steps you will find that you are unable to check-out the repository. In this case, you need to tell SmartSVN to use the proxy server. Here is how to do this:
- In the main SmartSVN window, go to the "Repository" menu and choose "Manage Profiles". There are three tabs at the top left, click on the middle one, "Proxies".
- Here, you can enter your proxy hostname/port/username/password here, and click "Add". Now go back to the "Profiles" tab, and select the SEDSAT-2 profile, and from the buttons on the right, choose "Edit".
- An "Edit Repository Profile" window should appear, and there is a drop-down menu which allows you to set which proxy to use. Just choose the proxy you set up a few minutes earlier in the proxies tab and click "OK". It will attempt to connect to the proxy and make sure it can connect to the repository through the proxy, and if it can, the "Edit Repository Profile" window will disappear.
And that is the proxy set up!
However, if there is a problem with the proxy configuration, the "Edit Repository Profile" will not disappear when you click "OK", so if that is the case, you need to go back to your Proxy setup and check that the hostname/port/username/password is correct.




