wiki:SubversionConflictsActivity

Version 1 (modified by jdalbey, 7 years ago) (diff)

draft

SVN Conflicts Activity

This lab will require about 15 minutes to complete.

This activity is carried out in pairs. Select a partner and find a lab where you can work at adjacent workstations. You may use whichever Subversion client you wish. You should look at each other's monitor to observe the effect of the commands

You will be using the SVNtutorial branch of the repository you created in previous exercises.

Step Developer X Developer Y
---- ------------------------------------------------------------ -----------------------------------------------------------
1 In the SVNtutorial folder use a text editor to create a new file named songXXYY.txt where XX is the first developer's initials and YY is the second developer's initials. Copy and paste these four lines into the file:

Row, row, row your boat, Gently down the stream,Merrily, merrily, merrily, merrily,Life is but a dream.

Save the file.
2 Use the Subversion status command to verify the file's status is "unversioned".
3 Use the subversion add command to place the file under subversion control.
4 Commit the file with an appropriate log message.
5 Verify the SVNtutorial folder exists.
6 Issue the subversion update command. The song file should appear with developer x's name as author.
7 Edit song file and modify line 1: Change "boat" to "raft"
8 Issue the subversion update command. Right-click on the song file and choose "Update". Commit the file with an appropriate log message.
9 Edit song file and modify line 2: Change "stream" to "river"
10 Issue the subversion update command. Since modifications are on different lines there's no conflict and status still says "modified".
11 View the contents of the file to see "boat" has been changed to "raft" in line 1.
12 Commit the file with an appropriate log message.
13 Edit song file and modify line 2: Change "Gently" to "Swiftly"
14 Issue the subversion update command. The status says "conflicted" because both changes are to the same line of the file.
15 If you try to commit the file now, you get an error: 'song.txt' remains in conflict
16 Edit the file and observe where SVN has flagged the conflict. Row, row, row your raft, <<<<<<< .mine Swiftly down the stream, ======= Gently down the river, >>>>>>> .r9 Merrily, merrily, merrily, merrily, Life is but a dream. Modify the file, retaining BOTH "Swiftly" and "river" in line 2. Remove the other comments. Save the file. Right-click on the song file and choose "resolve conflicts". Right-click on the song file and choose "Update". Right-click on the song file and choose "Commit". Enter an appropriate log message.
17 Issue the subversion update command.
18 View the contents of the file to see the merged contents.
19 Open a terminal window and move to the Sandbox folder.
20 Enter: svn log songXXYY.txt Observe the Subversion log entries.
21 If you neglected to enter log messages, return to step 1 and perform the entire activity over, and include log messages.
22