Merge (repeated, no conflicts)

Simultaneously, both Harry and Sally realize that their code has no comments.

Harry:

trunk harry$ svn diff
Index: pb.c
===================================================================
--- pb.c    (revision 17)
+++ pb.c    (working copy)
@@ -47,6 +47,7 @@
         return -1;
     }
 
+    // lottery ball numbers are always shown sorted
     qsort(white_balls, 5, sizeof(int), my_sort_func);
 
     return 0;

trunk harry$ svn commit -m "just a comment"
Sending        trunk/pb.c
Transmitting file data .
Committed revision 18.

And Sally:

no_boys_allowed sally$ svn diff
Index: pb.c
===================================================================
--- pb.c    (revision 15)
+++ pb.c    (working copy)
@@ -35,7 +35,7 @@
 {
     int balls[6];
     int count_balls = 0;
-    int favorite = 0;
+    int favorite = 0;  // this should be a bool
 
     for (int i=1; i<argc; i++)
     {
@@ -69,10 +69,13 @@
         goto usage_error;
     }
 
+    // the power ball is always the last one given
     int power_ball = balls[5];
 
     int result = calculate_result(balls, power_ball);
 
+    // calculate result can return -1 if the ball numbers
+    // are out of range
     if (result < 0)
     {
         goto usage_error;

no_boys_allowed sally$ svn commit -m "a few comments"
Sending        no_boys_allowed/pb.c
Transmitting file data .
Committed revision 19.

Harry decides to try again to merge the changes from Sally’s branch.

Subversion does a nice job with the repeated merge here. On the first merge, it gets r14 through r16. On this second merge, it gets r17 through r19, because it remembered the previous merge.

lottery harry$ svn update
U    branches/no_boys_allowed/pb.c
Updated to revision 19.

lottery harry$ cd trunk

trunk harry$ svn merge ../branches/no_boys_allowed/
--- Merging r17 through r19 into '.':
U    pb.c

trunk harry$ svn diff

Property changes on: .
___________________________________________________________________
Modified: svn:mergeinfo
   Merged /branches/no_boys_allowed:r17-19

Index: pb.c
===================================================================
--- pb.c    (revision 19)
+++ pb.c    (working copy)
@@ -57,7 +57,7 @@
 {
     int balls[6];
     int count_balls = 0;
-    int favorite = 0;
+    int favorite = 0;  // this should be a bool
 
     for (int i=1; i<argc; i++)
     {
@@ -91,10 +91,13 @@
         goto usage_error;
     }
 
+    // the power ball is always the last one given
     int power_ball = balls[5];
 
     int result = calculate_result(balls, power_ball);
 
+    // calculate result can return -1 if the ball numbers
+    // are out of range
     if (result < 0)
     {
         goto usage_error;

No worries on the merge then. Harry checks to see if everything compiles, and commits the merge.

trunk harry$ make
gcc -std=c99 -Wall -Wextra -Werror pb.c -o pb

trunk harry$ svn commit -m "merge changes from sally"
Sending        trunk
Sending        trunk/pb.c
Transmitting file data .
Committed revision 20.