GNEU.ORG
Project: White SVN Orientation Robert I Chatman
Updated 10/10/2008
Project: White is an Unreal Tournament 3 Mod that focuses on team play. It is set in a star system on the verge of destruction, as its sun is caught up in the throes of a chain of supernovae. The colonies of this system have months till exodus, but which colonies will be included?
SVN Orientation October 10, 2008
Table of Contents Change Log
3
Subversion at a glance
4
SVN Tools and URLs
4
SVN Assignment #1 - Checkout!
5
SVN Assignment #2 – Commit!
6
SVN Assignment #3 – Deletion!
8
SVN Assignment #4 – Revisions!
9
Glossary
Robert I Chatman - Updated: 10/10/2008
11
2
SVN Orientation October 10, 2008
Change Log Name Bob Chatman Bob Chatman
3
Date 11/10/08 10/10/08
Comments Minor Formatting Tweaks Initial Work, Moving from Orientation Document
Robert I Chatman - Updated: 10/10/2008
SVN Orientation October 10, 2008
Subversion at a glance Subversion is what is called a source control system. It allows us to keep track of and collaborate over files without worry of losing changes or complications due to the fact that members are not working within the same location. For more information on why we use SVN please consult this document: http://www.pdfcoke.com/doc/7011/SVN-AND-MERGING SVN Tools and URLs Most members of the team use a tool called TortoiseSVN, which hooks into your windows environment and takes care of executing many of the complicated commands for you. It is available here: http://tortoisesvn.tigris.org/ Here are some important URLs for the SVN Base SVN Directory http://svn.assembla.com/svn/white Your WIP Directory http://svn.assembla.com/svn/white/WIP/ Trunk / Working copy http://svn.assembla.com/svn/white/Trunk/ Branches http://svn.assembla.com/svn/white/Branches/ Tags http://svn.assembla.com/svn/white/Tags/
Robert I Chatman - Updated: 10/10/2008
4
SVN Orientation October 10, 2008
SVN Assignment #1 - Checkout! What we are going to do is step through a checkout, commit and deletion with tortoise, to make sure you know what is going on. The pattern you will follow will be as follows: 1. 2. 3. 4. 5.
Create a new directory Right click that directory and go down to SVN Checkout… In the URL of repository you should input the path to your WIP Directory Ensure that HEAD revision is selected Click OK
At this point you are going to be prompted for a username and password, which are the same as your assembla username and password (SSO) that we discussed a while ago. Once you have provided your credentials you will be shown a directory with a .svn folder sitting over to one side. You have checked out your WIP directory. Fantastic Job =)
5
Robert I Chatman - Updated: 10/10/2008
SVN Orientation October 10, 2008
SVN Assignment #2 – Commit! Now we are going to commit a file to the repository 1. Right click in the directory and choose New > Text Document a. The type and contents of the file are arbitrary, you will be deleting it soon, but you may wish to add some text to it so you can confirm that this was indeed the file you committed. 2. Right click in the directory again and choose TortoiseSVN > Add… a. You will see a listing of all files that are not yet a part of the repository in this or any underlying directories listed here 3. Ensure your file is checked 4. Click OK
5. Right click your directory one last time and choose SVN Commit… 6. This window will list all files that have been changed or modified on your local drive since the last time you committed 7. Give a message to the tune of “Following Orientation Assignment #2” and click OK. You should see a window show up that allows you to follow the commit process. With your initial commit it will be very simple, and that is purposeful. We are just trying to get you on your feet for now. Working within your own directory will rarely result in issues where your files are in a conflicted state and even then, the process is pretty straight forward.
Robert I Chatman - Updated: 10/10/2008
6
SVN Orientation October 10, 2008
Note down the final line (where it says Completed At revision: {some number} as we will be needing it for the final assignment.) and feel free to close the window. You have committed a file to the SVN!
7
Robert I Chatman - Updated: 10/10/2008
SVN Orientation October 10, 2008
SVN Assignment #3 – Deletion! Our nearly final task for the day is to delete that file. The purpose of this step is just to get you accustomed with the SVN procedure, because it’s not as simple as basic file manipulation. Rest assured, you are in good hands! 1. Right click the file you created in the previous assignment and choose TortoiseSVN > Delete a. This will notify the repository system that the file is marked for deletion 2. Right click your directory one last time and choose SVN Commit… a. As before, this window will list all files that have been changed or modified on your local drive since the last time you committed 3. Give a message to the tune of “Following Orientation Assignment #3” and click OK You should see a window show up that allows you to follow the commit process. This time you should see that your file is being deleted from the repository. Once the commit is completed you should see that the file has been removed from your directory locally as well. You should never use the casual deletion from your file system to remove a file b/c it is a frustrating situation.
You should note that every time you commit any changes to the repository you are given a revision number. Noting these down is not entirely important because we have the Trac system that keeps track of the commits we do visually as well, but noting important commits, especially those of your own branches is often a good idea.
Robert I Chatman - Updated: 10/10/2008
8
SVN Orientation October 10, 2008
SVN Assignment #4 – Revisions! This is probably the most complicated part of version control, because without an understanding of what this does you probably won’t find a purpose to all this extra work that we are doing with our files. Choosing a revision is not a complicated process, in fact you already have! When you committed your file you were provided with a revision number. You can now use that to retrieve your now defunct file from the repository. The beauty of this is that you no longer need to keep 100 versions of the files you are working on local, instead you commit your changes to the SVN and continue working. When you need to compare or maybe you made a change that you can’t undo any further you can step back to a previously committed version of your file. This process is referred to as re-versioning and we are going to do it right now! 1. Right click your directory and choose TortoiseSVN > Update to revision… 2. In the text field next to revision type in your revision number, mine is 3 3. Click OK You should be shown our favorite window once again, this time showing you the progress of moving to the previous revision. When it has completed you should see that file that we strategically deleted has been resurrected and is once again available for you. Be aware though, if you reversion your directory you will more than likely lose your modifications to that directory that have not been committed. For our purposes here you were working in a short time period and didn’t have any, so you shouldn’t have any issues.
9
Robert I Chatman - Updated: 10/10/2008
SVN Orientation October 10, 2008 With a couple words of caution, you are hereby unleashed on the wonders of the SVN. Feel free to look around, Tortoise has a number of very useful tools that you should get acclimated with if you intend to stay a part of the Software Engineering spectrum. I.
II.
III. IV.
Make sure you leave meaningful comments when making a commit, but don’t overdo it. a. You don’t have to list every change you are making, but if you are making more than a couple you should probably be committing more often. b. As a rule of thumb, you should be able to follow the changes to the repository by reading the comments alone, ignoring the files being committed. Try to group lots of actions together when possible. Inflating the revision tree is a hassle for all of us a. Do not commit to anyone else’s branches, without prior approval. When making the branch it is often a good idea to explain what the purpose of the branch is and who has access. Don’t delete the .svn folders in your various directories.
That said, please enjoy!
Robert I Chatman - Updated: 10/10/2008
10
SVN Orientation October 10, 2008
Glossary Term SVN Source Control Commit Revision SSO
11
Definition Sub Version Source Control system A system used to organize and audit file changes on a software engineering project The act of sending your changes to the server A specified audit version Single Sign On
Robert I Chatman - Updated: 10/10/2008