Diff
Not logged in

Differences From:

File src/clone.c part of check-in [945ecd1a8b] - Add support for "file:" URLs on push, pull, and sync. by drh on 2009-04-11 12:51:44. [view]

To:

File src/clone.c part of check-in [7a2c37063a] - merge trunk into creole branch by bob on 2009-09-22 07:49:39. Also file src/clone.c part of check-in [02a584f7f5] - Add the --private option to the "fossil commit" command. This option creates a private branch which is never pushed. by drh on 2009-08-26 18:25:48. [view]

@@ -42,9 +42,9 @@
   url_proxy_options();
   if( g.argc!=4 ){
     usage("FILE-OR-URL NEW-REPOSITORY");
   }
-  db_open_config();
+  db_open_config(0);
   if( file_size(g.argv[3])>0 ){
     fossil_panic("file already exists: %s", g.argv[3]);
   }
   url_parse(g.argv[2]);
@@ -51,17 +51,22 @@
   if( g.urlIsFile ){
     file_copy(g.urlName, g.argv[3]);
     db_close();
     db_open_repository(g.argv[3]);
-    db_open_config();
     db_record_repository_filename(g.argv[3]);
     db_multi_exec(
       "REPLACE INTO config(name,value)"
       " VALUES('server-code', lower(hex(randomblob(20))));"
       "REPLACE INTO config(name,value)"
-      " VALUES('last-sync-url', 'file://%q');",
-      g.urlName
+      " VALUES('last-sync-url', '%q');",
+      g.urlCanonical
+    );
+    db_multi_exec(
+       "DELETE FROM blob WHERE rid IN private;"
+       "DELETE FROM delta wHERE rid IN private;"
+       "DELETE FROM private;"
     );
+    shun_artifacts();
     g.zLogin = db_text(0, "SELECT login FROM user WHERE cap LIKE '%%s%%'");
     if( g.zLogin==0 ){
       db_create_default_users(1);
     }
@@ -74,9 +79,9 @@
     db_initial_setup(0, 0);
     user_select();
     db_set("content-schema", CONTENT_SCHEMA, 0);
     db_set("aux-schema", AUX_SCHEMA, 0);
-    db_set("last-sync-url", g.argv[2], 0);
+    db_set("last-sync-url", g.urlCanonical, 0);
     db_multi_exec(
       "REPLACE INTO config(name,value)"
       " VALUES('server-code', lower(hex(randomblob(20))));"
     );