Differences From:
File
src/clone.c
part of check-in
[c9fdb846fb]
- Add the "help" command and the "clean" command. More work is needed
on the text for various help messages.
by
drh on
2007-08-18 02:45:47.
[view]
To:
File
src/clone.c
part of check-in
[097479f99a]
- Better defaults for new databases and clones. Use *CURRENT* to identify
the current checkout for TTY timelines.
by
drh on
2007-09-26 02:00:26.
[view]
@@ -46,21 +46,23 @@
}
url_parse(g.argv[2]);
db_create_repository(g.argv[3]);
db_open_repository(g.argv[3]);
+ db_begin_transaction();
+ db_initial_setup(0, 0);
user_select();
db_set("content-schema", CONTENT_SCHEMA);
db_set("aux-schema", AUX_SCHEMA);
if( !g.urlIsFile ){
db_set("last-sync-url", g.argv[2]);
}
db_multi_exec(
- "INSERT INTO config(name,value) VALUES('server-code', hex(randomblob(20)));"
+ "INSERT INTO config(name,value)"
+ " VALUES('server-code', lower(hex(randomblob(20))));"
);
if( g.urlIsFile ){
Stmt q;
db_multi_exec("ATTACH DATABASE %Q AS orig", g.urlName);
- db_begin_transaction();
db_prepare(&q,
"SELECT name FROM orig.sqlite_master"
" WHERE type='table'"
);
@@ -69,9 +71,9 @@
db_multi_exec("INSERT OR IGNORE INTO %Q SELECT * FROM orig.%Q",
zTab, zTab);
}
db_finalize(&q);
- db_end_transaction(0);
}else{
client_sync(0,0,1);
}
+ db_end_transaction(0);
}