Subversion Training Activity

The recommended tool for source code control in this course is Subversion (SVN).   In this exercise you will modify a file that the entire team is developing together.

This tutorial takes approximately 20 minutes to complete. 

References

RapidSVN tutorial.

Prerequisites

This activity uses the RapidSVN Subversion client for Linux.  Be sure it is installed on your workstation.
Before you can complete this activity, you must have registered for an account at xp-dev.com/register  and the instructor must have given you write permission to the CPE308Training repository.   The instructor must have added a file named poem.txt to the repository.  The file should contain the title to the lyrics of "Stairway to Heaven."

Directions

In this training you will modify a file that other developers are also modifying.  You will checkout the repository, modify the file, update your repository, and commit your changes.

View the current file in the repository

  1. View the CPE308Training Repository.
  2. Click  trunk > Sandbox > poem.txt
  3. Observe the current state of the file and the current Revision number.  Observe how many lines have been added by other students.  Notice in particular the last line in the file.  Locate this line in the lyrics.  Your objective is to add the next line from the lyrics to the file.

Checkout a repository branch with RapidSVN.

  1. Start RapidSVN.
  2. Choose Repository > Checkout (Ctrl + O).
  3. In the Checkout dialog,
    Specify URL: http://svn.xp-dev.com/svn/CPE308TrainingRepository/trunk
    Specify Destination Directory: /home/USERNAME/Training
  4. Click OK.
  5. Wait for a moment while the repository is downloaded to your hard disk. You should observe Subversion messages similar to this:
    Execute: Checkout
    Added: /home/jdalbey/Training/Sandbox
    Added: /home/jdalbey/Training/Sandbox/poem.txt
    Updated: /home/jdalbey/Training
    Updating...
    Ready
  6. When completed, the Sandbox folder appears in the right-hand window, and a new bookmark appears in the left-hand window.
  7. Double-click on the Sandbox folder in the right-hand window and it opens to show poem.txt.

Modify the file

  1. Right-click on poem.txt and choose Edit.
  2. The file contents appears in the editor window.
  3. Add the next line of the lyrics to the end of the file.  Place your initials at the beginning of the line.  Save the file and close the editor.
  4. Observe in the right-hand window the file status is now "modified."

Update and commit

  1. (Important) Right-click on poem.txt and choose Update.  This step is important to make sure you have the latest verson in the event that someone else modified the file while you were completing this training.  If the file status remains "modified" proceed to the next step.  If the file status says "conflicted" right-click on the file and choose Revert.  Then repeat the previous step to modify the file.
  2. Right-click on poem.txt and choose Commit.  A Commit Dialog appears.
  3. In the Enter log message text area, type a simple descriptive log entry such as "added a line to the lyrics for SVN training."
  4. Click OK.
  5. If you are prompted for a username and password, enter the username/password with which you registered.
  6. Observe the Subversion messages:
    Execute: Commit
    Modified: poem.txt
    Committed revision x.
    Updating...
    Ready
  7. To view the complete history of changes to the file,
    Right-click and choose Log
  8. The Log History window appears.  Observe previous authors.  Click Close.
  9. Congratulations, you're done!

Using Subversion command line client

  1. Sometimes the Subversion command line client is easier than RapidSVN:
    mkdir Training
    cd Training
    svn co http://svn.xp-dev.com/svn/CPE308TrainingRepository/trunk
    cd trunk
    cd Sandbox
    vi poem.txt
    (modify file)
    svn update
    svn commit
    (enter log message)


Stairway to Heaven lyrics

Stairway to Heaven

There's a lady who's sure
All that glitters is gold
And she's buying a stairway to heaven

When she gets there she knows
If the stores are all closed
With a word she can get what she came for

Ooh, ooh, ooh, ooh, ooh
And she's buying a stairway to heaven

There's a sign on the wall
But she wants to be sure
'Cause you know sometimes words have
Two meanings

In a tree by the brook
There's a songbird who sings
Sometimes all of our thoughts are
Misgiven

Ooh, it makes me wonder

Ooh, it makes me wonder

There's a feeling I get
When I look to the west
And my spirit is crying
For leaving

In my thoughts I have seen
Rings of smoke through the trees
And the voices of those
Who stand looking

Ooh, it makes me wonder

Ooh, it really makes me wonder

And it's whispered that soon
If we all call the tune
Then the piper will lead us to reason

And a new day will dawn
For those who stand long
And the forests will
Echo with laughter

If there's a bustle in your hedgerow
Don't be alarmed now
It's just a spring clean
For the May queen

Yes, there are two paths you can go by
But in the long run
There's still time to change
The road you're on

And it makes me wonder

Your head is humming and it won't go
In case you don't know
The piper's calling you to join him

Dear lady, can you hear the wind blow?
And did you know
Your stairway lies on the whispering wind?

And as we wind on down the road
Our shadows taller than our soul
There walks a lady we all know
Who shines white light and wants to show
How everything still turns to gold
And if you listen very hard
The truth will come to you at last
When all are one and one is all
To be a rock and not to roll

And she's buying a stairway
To heaven...