Rename

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

lottery harry$ vv add Makefile

lottery harry$ vv rename src/lottery.c pb.c

lottery harry$ vv st
   Added:  @/Makefile
 Renamed:  @/src/pb.c
        # was lottery.c
   Found:  @/a.out
   Found:  @/pb

Note that Veracity has separate commands for rename and move. Its architecture treats the name of the file as a distinct attribute from the directory in which it resides.

lottery harry$ vv commit -m "Makefile. and lottery.c was too long to type."

    revision:  12:674a480f641b6f206fac2aad1751ae44946a80f6
      branch:  master
         who:  harry
        when:  2011/05/31 10:58:49.906 -0500
     comment:  Makefile. and lottery.c was too long to type.
      parent:  11:3cc62d4c79e2f3a94bb2731e84d2304a10760938

lottery harry$ vv push
Pushing to http://server.futilisoft.com:8080/repos/lottery:
Pushing... Done.                                                               

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

lottery sally$ vv diff
=== ================
===   Modified: File @/lottery.c
--- @/src/lottery.c 4da6892d436bbab66c980639d3c975cc2da28f99
+++ @/src/lottery.c 2011/05/31 15:59:47.000 +0000
@@ -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.

lottery sally$ vv commit -m "more #defines"

    revision:  12:d68d482736fecc60549110855becd2e0155f1ef5
      branch:  master
         who:  sally
        when:  2011/05/31 11:00:25.105 -0500
     comment:  more #defines
      parent:  11:3cc62d4c79e2f3a94bb2731e84d2304a10760938

lottery sally$ vv push
vv: Error 234 (sglib): The branch needs to be merged.

Grrr. That Harry is dumber than a coal bucket.

lottery sally$ vv pull
Pulling from http://server.futilisoft.com:8080/repos/lottery:
Pulling... Done.                                                               

lottery sally$ vv heads

    revision:  13:674a480f641b6f206fac2aad1751ae44946a80f6
      branch:  master
         who:  harry
        when:  2011/05/31 10:58:49.906 -0500
     comment:  Makefile. and lottery.c was too long to type.
      parent:  11:3cc62d4c79e2f3a94bb2731e84d2304a10760938

    revision:  12:d68d482736fecc60549110855becd2e0155f1ef5
      branch:  master
         who:  sally
        when:  2011/05/31 11:00:25.105 -0500
     comment:  more #defines
      parent:  11:3cc62d4c79e2f3a94bb2731e84d2304a10760938

lottery sally$ vv merge
1 updated, 0 deleted, 1 added, 0 merged, 0 unresolved

lottery sally$ make
gcc -std=c99 -Wall -Wextra -Werror src/pb.c -o pb

lottery sally$ vv commit -m "merge"

    revision:  14:b11eaca1a7be8684069e9ce461f42f834acae344
      branch:  master
         who:  sally
        when:  2011/05/31 11:01:19.139 -0500
     comment:  merge
      parent:  13:674a480f641b6f206fac2aad1751ae44946a80f6
      parent:  12:d68d482736fecc60549110855becd2e0155f1ef5

lottery sally$ vv push
Pushing to http://server.futilisoft.com:8080/repos/lottery:
Pushing... Done.