Rename

Harry decides the time has come to create a proper Makefile. And also to gratuitously rename lottery.c.

trunk harry$ svn add Makefile
A         Makefile

trunk harry$ svn move lottery.c pb.c
A         pb.c
D         lottery.c

trunk harry$ svn commit -m "Makefile. and lottery.c was too long to type."
Adding         trunk/Makefile
Deleting       trunk/lottery.c
Adding         trunk/pb.c
Transmitting file data .
Committed revision 8.

Sally maintains her momentum with #define and adds names for the ball ranges.

trunk sally$ svn diff
Index: lottery.c
===================================================================
--- lottery.c   (revision 7)
+++ lottery.c   (working copy)
@@ -3,6 +3,8 @@
 #include <stdlib.h>
 
 #define LUCKY_NUMBER 7
+#define MAX_WHITE_BALL 59
+#define MAX_POWER_BALL 39
 
 int calculate_result(int white_balls[5], int power_ball)
 {
@@ -10,7 +12,7 @@
     {
         if (
              (white_balls[i] < 1)
-             || (white_balls[i] > 59)
+             || (white_balls[i] > MAX_WHITE_BALL)
            )
         {
             return -1;
@@ -19,7 +21,7 @@
 
     if (
          (power_ball < 1)
-         || (power_ball > 39)
+         || (power_ball > MAX_POWER_BALL)
        )
     {
         return -1;

And commits her changes.

trunk sally$ svn commit -m "more #defines"
Sending        trunk/lottery.c
Transmitting file data .svn: Commit failed (details follow):
svn: File not found: transaction '8-b', path '/trunk/lottery.c'

Grrr. Tree conflict problem again. That Harry is dumber than a box of rocks. This looks a lot like the last problem she had, so she figures it’ll get fixed the same way.

trunk sally$ svn update
   C lottery.c
A    pb.c
A    Makefile
Updated to revision 8.
Summary of conflicts:
  Tree conflicts: 1

trunk sally$ svn st
M       pb.c
A  +  C lottery.c
      >   local edit, incoming delete upon update

trunk sally$ svn revert lottery.c
Reverted 'lottery.c'

trunk sally$ svn st
?       lottery.c
M       pb.c

trunk sally$ rm lottery.c

trunk sally$ svn st
M       pb.c

Even though Subversion did not handle this incoming rename merge gracefully, it is interesting to note that it correctly produced pb.c, complete with Sally’s changes in it.

trunk sally$ svn commit -m "more #defines"
Sending        trunk/pb.c
Transmitting file data .
Committed revision 9.