Check-in [8b630bb57a]
Not logged in
Overview

SHA1 Hash:8b630bb57a21912ca2b925fb8cabaa0d66d0654c
Date: 2009-08-08 22:40:28
User: drh
Comment:Provide --user-override option on the ci command and the --date-override option on the new command. Make a correction to the file format document.
Timelines: ancestors | descendants | both | trunk
Other Links: files | ZIP archive | manifest

Tags And Properties
Changes
[hide diffs]

Modified src/checkin.c from [54d694aac3] to [d9477045cd].

@@ -410,10 +410,11 @@
   char *zManifestFile;   /* Name of the manifest file */
   int nBasename;         /* Length of "g.zLocalRoot/" */
   const char *zBranch;   /* Create a new branch with this name */
   const char *zBgColor;  /* Set background color when branching */
   const char *zDateOvrd; /* Override date string */
+  const char *zUserOvrd; /* Override user name */
   Blob filename;         /* complete filename */
   Blob manifest;
   Blob muuid;            /* Manifest uuid */
   Blob mcksum;           /* Self-checksum on the manifest */
   Blob cksum1, cksum2;   /* Before and after commit checksums */
@@ -424,10 +425,11 @@
   zComment = find_option("comment","m",1);
   forceFlag = find_option("force", "f", 0)!=0;
   zBranch = find_option("branch","b",1);
   zBgColor = find_option("bgcolor",0,1);
   zDateOvrd = find_option("date-override",0,1);
+  zUserOvrd = find_option("user-override",0,1);
   db_must_be_within_tree();
   noSign = db_get_boolean("omitsign", 0)|noSign;
   if( db_get_boolean("clearsign", 1)==0 ){ noSign = 1; }
   verify_all_options();
 
@@ -623,11 +625,11 @@
       const char *zTag = db_column_text(&q, 0);
       blob_appendf(&manifest, "T -%F *\n", zTag);
     }
     db_finalize(&q);
   }
-  blob_appendf(&manifest, "U %F\n", g.zLogin);
+  blob_appendf(&manifest, "U %F\n", zUserOvrd ? zUserOvrd : g.zLogin);
   md5sum_blob(&manifest, &mcksum);
   blob_appendf(&manifest, "Z %b\n", &mcksum);
   zManifestFile = mprintf("%smanifest", g.zLocalRoot);
   if( !noSign && clearsign(&manifest, &manifest) ){
     Blob ans;

Modified src/db.c from [cef5f87864] to [fa41711549].

@@ -913,15 +913,16 @@
 ** Fill an empty repository database with the basic information for a
 ** repository. This function is shared between 'create_repository_cmd'
 ** ('new') and 'reconstruct_cmd' ('reconstruct'), both of which create
 ** new repositories.
 **
-** The makeInitialVersion flag determines whether or not an initial
-** manifest is created.  The makeServerCodes flag determines whether or
+** The zInitialDate parameter determines the date of the initial check-in
+** that is automatically created.  If zInitialDate is 0 then no initial
+** check-in is created. The makeServerCodes flag determines whether or
 ** not server and project codes are invented for this repository.
 */
-void db_initial_setup (int makeInitialVersion, int makeServerCodes){
+void db_initial_setup (const char *zInitialDate, int makeServerCodes){
   char *zDate;
   Blob hash;
   Blob manifest;
 
   db_set("content-schema", CONTENT_SCHEMA, 0);
@@ -937,15 +938,15 @@
   if( !db_is_global("autosync") ) db_set_int("autosync", 1, 0);
   if( !db_is_global("localauth") ) db_set_int("localauth", 0, 0);
   db_create_default_users(0);
   user_select();
 
-  if (makeInitialVersion){
+  if( zInitialDate ){
     int rid;
     blob_zero(&manifest);
     blob_appendf(&manifest, "C initial\\sempty\\scheck-in\n");
-    zDate = db_text(0, "SELECT datetime('now')");
+    zDate = db_text(0, "SELECT datetime(%Q)", zInitialDate);
     zDate[10]='T';
     blob_appendf(&manifest, "D %s\n", zDate);
     blob_appendf(&manifest, "P\n");
     md5sum_init();
     blob_appendf(&manifest, "R %s\n", md5sum_finish(0));
@@ -969,18 +970,22 @@
 ** This command is distinct from "clone".  The "clone" command makes
 ** a copy of an existing project.  This command starts a new project.
 */
 void create_repository_cmd(void){
   char *zPassword;
+  const char *zDate;          /* Date of the initial check-in */
+
+  zDate = find_option("date-override",0,1);
+  if( zDate==0 ) zDate = "now";
   if( g.argc!=3 ){
     usage("REPOSITORY-NAME");
   }
   db_create_repository(g.argv[2]);
   db_open_repository(g.argv[2]);
   db_open_config();
   db_begin_transaction();
-  db_initial_setup(1, 1);
+  db_initial_setup(zDate, 1);
   db_end_transaction(0);
   printf("project-id: %s\n", db_get("project-code", 0));
   printf("server-id:  %s\n", db_get("server-code", 0));
   zPassword = db_text(0, "SELECT pw FROM user WHERE login=%Q", g.zLogin);
   printf("admin-user: %s (initial password is \"%s\")\n", g.zLogin, zPassword);

Modified www/fileformat.wiki from [9924363ba6] to [ab44da6d91].

@@ -156,17 +156,10 @@
 always readable and writable.  This can be expressed by "w" permission
 if desired but is optional.
 The optional 4th argument is the name of the same file as it existed in
 the parent check-in.  If the name of the file is unchanged from its
 parent, then the 4th argument is omitted.
-</p>
-
-<p>
-A manifest has zero or more N-cards.  Each N card records a name changes
-to one of the files in the manifest.  The first argument to the N code is
-the name of the file in the parent check-in.  The second argument is the
-name of the file in the check-in defined by the manifest.
 </p>
 
 <p>
 A manifest has zero or one P-cards.  Most manifests have one P-card.
 The P-card has a varying number of arguments that