Collaborative Poetry

Introducing TortoiseSVN by Writing Poetry as a Team

Goal: To get practice checking out repositories, updating and committing work done. Each team will write a short poem, one line at a time. Each student will get the latest version in progress ("update"), add a line, and save the updated version for others to see ("commit").

Instructions:

  1. If you do not have TortoiseSVN (the Windows client for Subversion) installed, you will not be able to participate at this time. You will have to install TortoiseSVN and do this exercise as part of Homework 1. Please look on with a classmate during class.
  2. Make sure that you know your SVN password, as established earlier in the session. Recall that your SVN username is the same as your Kerberos username.
  3. Group into teams as assigned by your instructor. Quickly decide upon a poetry style you will use, for example, straight rhyme, limericks, or haiku.
  4. Note the team name that your instructor gave you. Your instructor has already created a repository for your team. It is just an empty repository so far, but it exists on the Subversion server, as:
    	http://svn.cs.rose-hulman.edu/repos/csse221-201110-YOUR_TEAM_NAME
    
    where you replace YOUR_TEAM_NAME by the name of your team.
  5. Each team member:
    1. Create a folder somewhere on your laptop, probably inside MyDocuments > Courses > CSSE221 (make that folder now if you haven't). You can name the folder whatever you want. It is going to be your own working copy of the repository your team is sharing.
    2. SVN Checkout the repository into your (empty) working copy.
      • Do you see why all team members can do this step at the same time, without fear of conflicts?
      • After doing your SVN Checkout, look at the contents of your working copy folder -- it is no longer empty. Did your folder turn green? (If not, get help now.)
    3. Team members Alpha and Beta both do the following at the same time:
      1. Think of a line of poetry (any line, be creative!)
      2. Create a new Text Document (.txt file) inside your working copy folder.
        • Important: Alpha should name her file Poetry.txt while Beta should name her file MorePoetry.txt.
      3. Add your line of poetry to your .txt file, using any text editor you choose (e.g. Wordpad).
      4. Tortoise SVN   →   Add your file (Poetry.txt or MorePoetry.txt).
        • This just tells TortoiseSVN to put the file under version control.
        • The file should get colored (you may have to Refresh the folder first). If not, get help now.
      5. SVN Update your working copy.
        • Do you see why neither Alpha nor Beta will get a conflict at this step?
      6. SVN Commit your changes to the repository.
        • Make sure to write a brief comment for the log - a simple message such is "Added first line of poetry to YOUR_FILE" (where YOUR_FILE is either Poetry.txt or MorePoetry.txt -- Tortoise will help you with the filename) will do.
    4. Team members Gamma and Delta now both do the following at the same time:
      1. SVN Update your working copy.
        • After the update, you should see both Poetry.txt and MorePoetry.txt in your working copy. If not, get help now.
      2. Think of a line of poetry (any line, be creative!)
      3. Add your line of poetry to your poetry file, using any text editor you choose.
        • Important: Gamma should add her line to file Poetry.txt while Delta should add her line to file MorePoetry.txt.
      4. SVN Update your working copy.
        • Do you see why neither Gamma nor Delta will get a conflict at this step?
      5. SVN Commit your changes to the repository.
        • Make sure to write a brief but appropriate comment for the log.
    5. Team members Epsilon and Zeta (if they exist) repeat Step d, adding their own lines to the respective files.
    6. Team members Alpha and Beta repeat Step d, adding the second line that they have chosen.
    7. Team members Gamma and Delta repeat Step d, adding the second line that they have chosen.
    8. Team members Epsilon and Zeta (if they exist) repeat Step d, adding the second line that they have chosen.
    9. At this point, the repository contains two files that contain the lines the team has chosen. What does each team member have to do now, so that everyone on the team has a working copy that is up-to-date? (If you aren't sure, ask!) Do it now!
    10. Explain to each other the cyclical workflow that you used. It is typical of a team using TortoiseSVN. Now is the time to ask questions as needed!
    11. Optional step, just for grins: Try to access another team's poetry. You will find that you cannot (without their help).
    12. Optional step, just for grins: have two team members work on the same file at the same time, with one team member changing the first line of the file, and the other team member changing the last line of the file. What happens? Can you force a conflict? (Don't worry about how to manage a conflict today -- more on that later.)

    Resources

    Here are some resources that you can refer to while doing this assignment.

    To check out a repository (SVN Checkout):

    1. Create a new (hence empty) folder somewhere on your laptop (e.g. in My Documents) to hold your working copy.
    2. Right-click on (or within, either works) the folder and choose SVN Checkout...
    3. A dialog box appears. In it, enter as a URL:
      	http://svn.cs.rose-hulman.edu/repos/csse221-201110-YOUR_TEAM_NAME
      
      where you replace YOUR_TEAM_NAME by the name of your team.
      • More generally, put the name of the repository that you are using. It will vary from assignment to assignment.
      • Case matters. Type carefully.
    4. When prompted, enter your username and your password.
      • This password will be used repeatedly this term, so don't lose it. Mail it to yourself.
    5. TortoiseSVN should put your working copy under version control and copy the current contents of the repository from the server into your working copy on your laptop. Each folder in your working copy will contain a .svn folder and possibly some content. The files/folders in your working copy get colored.

    To put new files in your local copy under version control (SVN Tortoise   →   Add):

    1. Choose the file/folder you want to add. Right-click on it and choose SVN Tortoise   →   Add.

    This just tells TortoiseSVN that you want these files placed under version control. (You can have files in your working copy that are not under version control, if you wish.)

    To update your local copy (SVN Update):

    1. Choose the folder you want to update. Right-click on it and choose SVN Update.

    A dialog box will tell you which files have been changed since you last updated your copy.

    The update copies the changed files from the repository on the server to your working copy on your laptop, unless there are conflicts.

    To commit changes to the repository (SVN Commit):

    1. Choose the folder containing the changes you want to commit. Right-click on it and choose SVN Commit...
      • Note: it is quickest to choose the deepest folder containing the changed files. However, if you have made changes to multiple folders, you may select the deepest folder containing all those folders and commit all changes in a single step.
    2. In the dialog box, enter a brief comment about the changes you made. If you ever need to roll back to a previous version (a benefit of version control), this will help you find which copy to use.
    3. If changes were made to more than one file, and you don't want to commit all the files, you may unselect ones as needed.
    4. Click OK.

    A dialog box will tell you which files were committed.

    To resolve conflicts if they arise

    See this document. This is just a reference for later.