wiki:SubversionTraining

Subversion Training Activity

The TMC project uses Subversion for source code control. In this exercise you will modify a file that the entire team is developing together.

This tutorial takes approximately 20 minutes to complete.

Prerequisites

This activity uses the command line Subversion client (Ver 1.9) for Linux. Be sure it is installed on your workstation.

You must have an account on dev.tmcacad.com.

The instructor must have added a file named poem.txt to the repository. The file should contain the opening lyrics to " Stairway to Heaven"

Directions

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

Checkout a repository branch.

  1. Open a terminal window. Create a new directory where you want your subversion "working directory" to exist. Make it the current directory.
  1. Checkout the desired branch from the project repository:
    svn checkout svn+ssh://dev.tmcacad.com/svn/tmcsimulator/branches/SVNtutorial/
    
  1. Wait for a moment while the repository is downloaded to your directory. You should observe a list of files and then a Subversion messages similar to this:
    Checked out revision 487.
    
  2. List the contents of the directory to verify the poem file was checked out.

Modify the file

  1. Open poem.txt in a text editor.
  1. 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.
  1. Issue the subversion status command and observe the file state is "modified".
    svn status
    

Update and commit

  1. (Important) Issue the subversion update command.
    svn update
    
    This step is important to make sure you have the latest version 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" issue the revert command ( svn revert poem.txt ). Then repeat the previous step to modify the file.
  1. Issue the subversion commit command.
    svn commit -m "added a line to the lyrics for SVN training."
    
  1. Observe the Subversion messages:
    Transmitting file data .done Committing transaction... Committed revision 488.
    
  2. To view the complete history of changes to the current folder, issue the subversion log command.
    svn log
    
  3. The Log History display appears. Observe previous authors.
  1. Congratulations, you're done!