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 CPE308Training
Repository.
- Click trunk > Sandbox > poem.txt
- 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.
- Start RapidSVN.
- Choose Repository > Checkout (Ctrl + O).
- In the Checkout dialog,
Specify URL: http://svn.xp-dev.com/svn/CPE308TrainingRepository/trunk
Specify Destination Directory: /home/USERNAME/Training
Click OK.
- 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
- When completed, the Sandbox folder appears in the right-hand
window, and a new bookmark appears in the left-hand window.
- Double-click on the Sandbox folder in the right-hand window and
it opens to show poem.txt.
- Right-click on poem.txt and choose Edit.
- The file contents appears in the editor window.
- 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.
- Observe in the right-hand window the file status is now
"modified."
- (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.
- Right-click on poem.txt and choose Commit. A Commit Dialog
appears.
- In the Enter log message text area, type a simple
descriptive log entry such as "added a line to the
lyrics for SVN training."
- Click OK.
- If you are prompted for a username and password, enter the
username/password
with which you registered.
- Observe the Subversion messages:
Execute: Commit
Modified: poem.txt
Committed revision x.
Updating...
Ready
- To view the complete history of changes to the file,
Right-click and choose Log
- The Log History window appears. Observe previous
authors. Click Close.
- Congratulations, you're done!
- 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...