Diff
Not logged in

Differences From:

File src/db.c part of check-in [418207989a] - Add the "unset" command for clearing settings. by drh on 2008-05-10 17:22:07. [view]

To:

File src/db.c part of check-in [6b85fd173e] - Help message cleanup. Automatically delete cloned database files if the clone fails. by drh on 2008-05-10 18:01:52. [view]

@@ -76,8 +76,9 @@
   exit(1);
 }
 
 static int nBegin = 0;      /* Nesting depth of BEGIN */
+static int isNewRepo = 0;   /* True if the repository is newly created */
 static int doRollback = 0;  /* True to force a rollback */
 static int nCommitHook = 0; /* Number of commit hooks */
 static struct sCommitHook {
   int (*xHook)(void);  /* Functions to call at db_end_transaction() */
@@ -125,8 +126,12 @@
 }
 void db_force_rollback(void){
   if( nBegin ){
     sqlite3_exec(g.db, "ROLLBACK", 0, 0, 0);
+    if( isNewRepo ){
+      db_close();
+      unlink(g.zRepositoryName);
+    }
   }
   nBegin = 0;
 }
 
@@ -731,8 +736,9 @@
      zRepositorySchema1,
      zRepositorySchema2,
      (char*)0
   );
+  isNewRepo = 1;
 }
 
 /*
 ** Fill an empty repository database with the basic information for a
@@ -805,8 +811,9 @@
 /*
 ** COMMAND: new
 **
 ** Usage: %fossil new FILENAME
+**
 ** Create a repository for a new project in the file named FILENAME.
 ** This command is distinct from "clone".  The "clone" command makes
 ** a copy of an existing project.  This command starts a new project.
 */
@@ -1114,15 +1121,15 @@
 */
 void setting_cmd(void){
   static const char *azName[] = {
     "autosync",
-    "pgp-command",
+    "diff-command",
     "editor",
+    "gdiff-command",
     "localauth",
     "omitsign",
-    "proxy",
-    "diff-command",
-    "gdiff-command",
+    "pgp-command",
+    "proxy",
   };
   int i;
   int globalFlag = find_option("global","g",0)!=0;
   int unsetFlag = g.argv[1][0]=='u';