Fossil SCM

Skip all finalizing until the clone is complete.

andybradford 2023-12-01 20:12 clone-resume
Commit 9fa25cd746c771a433f90db18a29624ac650ab1c0ee529b423047b9ce25222e0
1 file changed +31 -31
+31 -31
--- src/clone.c
+++ src/clone.c
@@ -322,11 +322,10 @@
322322
db_open_repository(zRepo);
323323
#if !defined(_WIN32)
324324
signal(SIGINT, SIG_DFL);
325325
#endif
326326
}
327
- db_begin_transaction();
328327
if( db_exists("SELECT 1 FROM delta WHERE srcId IN phantom") ){
329328
if( db_get_int("aux-clone-seqno",0)==0 ){
330329
fossil_fatal("there are unresolved deltas -"
331330
" the clone is probabaly incomplete and unusable.");
332331
}
@@ -333,10 +332,11 @@
333332
}
334333
if( db_get_int("aux-clone-seqno",0)>1 ){
335334
fossil_warning("It may be possible to resume the"
336335
" clone by running the same command again.");
337336
}else{
337
+ db_begin_transaction();
338338
fossil_print("Rebuilding repository meta-data...\n");
339339
rebuild_db(1, 0);
340340
if( !noCompress ){
341341
int nDelta = 0;
342342
i64 nByte;
@@ -348,40 +348,40 @@
348348
fossil_print("%d deltas save %,lld bytes\n", nDelta, nByte);
349349
}else{
350350
fossil_print("none found\n");
351351
}
352352
}
353
- }
354
- db_end_transaction(0);
355
- fossil_print("Vacuuming the database... "); fflush(stdout);
356
- if( db_int(0, "PRAGMA page_count")>1000
357
- && db_int(0, "PRAGMA page_size")<8192 ){
358
- db_multi_exec("PRAGMA page_size=8192;");
359
- }
360
- db_unprotect(PROTECT_ALL);
361
- db_multi_exec("VACUUM");
362
- db_protect_pop();
363
- fossil_print("\nproject-id: %s\n", db_get("project-code", 0));
364
- fossil_print("server-id: %s\n", db_get("server-code", 0));
365
- zPassword = db_text(0, "SELECT pw FROM user WHERE login=%Q", g.zLogin);
366
- fossil_print("admin-user: %s (password is \"%s\")\n", g.zLogin, zPassword);
367
- hash_user_password(g.zLogin);
368
- if( zWorkDir!=0 && zWorkDir[0]!=0 && !noOpen ){
369
- Blob cmd;
370
- fossil_print("opening the new %s repository in directory %s...\n",
371
- zRepo, zWorkDir);
372
- blob_init(&cmd, 0, 0);
373
- blob_append_escaped_arg(&cmd, g.nameOfExe, 1);
374
- blob_append(&cmd, " open ", -1);
375
- blob_append_escaped_arg(&cmd, zRepo, 1);
376
- blob_append(&cmd, " --nosync --workdir ", -1);
377
- blob_append_escaped_arg(&cmd, zWorkDir, 1);
378
- if( allowNested ){
379
- blob_append(&cmd, " --nested", -1);
380
- }
381
- fossil_system(blob_str(&cmd));
382
- blob_reset(&cmd);
353
+ db_end_transaction(0);
354
+ fossil_print("Vacuuming the database... "); fflush(stdout);
355
+ if( db_int(0, "PRAGMA page_count")>1000
356
+ && db_int(0, "PRAGMA page_size")<8192 ){
357
+ db_multi_exec("PRAGMA page_size=8192;");
358
+ }
359
+ db_unprotect(PROTECT_ALL);
360
+ db_multi_exec("VACUUM");
361
+ db_protect_pop();
362
+ fossil_print("\nproject-id: %s\n", db_get("project-code", 0));
363
+ fossil_print("server-id: %s\n", db_get("server-code", 0));
364
+ zPassword = db_text(0, "SELECT pw FROM user WHERE login=%Q", g.zLogin);
365
+ fossil_print("admin-user: %s (password is \"%s\")\n", g.zLogin, zPassword);
366
+ hash_user_password(g.zLogin);
367
+ if( zWorkDir!=0 && zWorkDir[0]!=0 && !noOpen ){
368
+ Blob cmd;
369
+ fossil_print("opening the new %s repository in directory %s...\n",
370
+ zRepo, zWorkDir);
371
+ blob_init(&cmd, 0, 0);
372
+ blob_append_escaped_arg(&cmd, g.nameOfExe, 1);
373
+ blob_append(&cmd, " open ", -1);
374
+ blob_append_escaped_arg(&cmd, zRepo, 1);
375
+ blob_append(&cmd, " --nosync --workdir ", -1);
376
+ blob_append_escaped_arg(&cmd, zWorkDir, 1);
377
+ if( allowNested ){
378
+ blob_append(&cmd, " --nested", -1);
379
+ }
380
+ fossil_system(blob_str(&cmd));
381
+ blob_reset(&cmd);
382
+ }
383383
}
384384
}
385385
386386
/*
387387
** If user chooses to use HTTP Authentication over unencrypted HTTP,
388388
--- src/clone.c
+++ src/clone.c
@@ -322,11 +322,10 @@
322 db_open_repository(zRepo);
323 #if !defined(_WIN32)
324 signal(SIGINT, SIG_DFL);
325 #endif
326 }
327 db_begin_transaction();
328 if( db_exists("SELECT 1 FROM delta WHERE srcId IN phantom") ){
329 if( db_get_int("aux-clone-seqno",0)==0 ){
330 fossil_fatal("there are unresolved deltas -"
331 " the clone is probabaly incomplete and unusable.");
332 }
@@ -333,10 +332,11 @@
333 }
334 if( db_get_int("aux-clone-seqno",0)>1 ){
335 fossil_warning("It may be possible to resume the"
336 " clone by running the same command again.");
337 }else{
 
338 fossil_print("Rebuilding repository meta-data...\n");
339 rebuild_db(1, 0);
340 if( !noCompress ){
341 int nDelta = 0;
342 i64 nByte;
@@ -348,40 +348,40 @@
348 fossil_print("%d deltas save %,lld bytes\n", nDelta, nByte);
349 }else{
350 fossil_print("none found\n");
351 }
352 }
353 }
354 db_end_transaction(0);
355 fossil_print("Vacuuming the database... "); fflush(stdout);
356 if( db_int(0, "PRAGMA page_count")>1000
357 && db_int(0, "PRAGMA page_size")<8192 ){
358 db_multi_exec("PRAGMA page_size=8192;");
359 }
360 db_unprotect(PROTECT_ALL);
361 db_multi_exec("VACUUM");
362 db_protect_pop();
363 fossil_print("\nproject-id: %s\n", db_get("project-code", 0));
364 fossil_print("server-id: %s\n", db_get("server-code", 0));
365 zPassword = db_text(0, "SELECT pw FROM user WHERE login=%Q", g.zLogin);
366 fossil_print("admin-user: %s (password is \"%s\")\n", g.zLogin, zPassword);
367 hash_user_password(g.zLogin);
368 if( zWorkDir!=0 && zWorkDir[0]!=0 && !noOpen ){
369 Blob cmd;
370 fossil_print("opening the new %s repository in directory %s...\n",
371 zRepo, zWorkDir);
372 blob_init(&cmd, 0, 0);
373 blob_append_escaped_arg(&cmd, g.nameOfExe, 1);
374 blob_append(&cmd, " open ", -1);
375 blob_append_escaped_arg(&cmd, zRepo, 1);
376 blob_append(&cmd, " --nosync --workdir ", -1);
377 blob_append_escaped_arg(&cmd, zWorkDir, 1);
378 if( allowNested ){
379 blob_append(&cmd, " --nested", -1);
380 }
381 fossil_system(blob_str(&cmd));
382 blob_reset(&cmd);
383 }
384 }
385
386 /*
387 ** If user chooses to use HTTP Authentication over unencrypted HTTP,
388
--- src/clone.c
+++ src/clone.c
@@ -322,11 +322,10 @@
322 db_open_repository(zRepo);
323 #if !defined(_WIN32)
324 signal(SIGINT, SIG_DFL);
325 #endif
326 }
 
327 if( db_exists("SELECT 1 FROM delta WHERE srcId IN phantom") ){
328 if( db_get_int("aux-clone-seqno",0)==0 ){
329 fossil_fatal("there are unresolved deltas -"
330 " the clone is probabaly incomplete and unusable.");
331 }
@@ -333,10 +332,11 @@
332 }
333 if( db_get_int("aux-clone-seqno",0)>1 ){
334 fossil_warning("It may be possible to resume the"
335 " clone by running the same command again.");
336 }else{
337 db_begin_transaction();
338 fossil_print("Rebuilding repository meta-data...\n");
339 rebuild_db(1, 0);
340 if( !noCompress ){
341 int nDelta = 0;
342 i64 nByte;
@@ -348,40 +348,40 @@
348 fossil_print("%d deltas save %,lld bytes\n", nDelta, nByte);
349 }else{
350 fossil_print("none found\n");
351 }
352 }
353 db_end_transaction(0);
354 fossil_print("Vacuuming the database... "); fflush(stdout);
355 if( db_int(0, "PRAGMA page_count")>1000
356 && db_int(0, "PRAGMA page_size")<8192 ){
357 db_multi_exec("PRAGMA page_size=8192;");
358 }
359 db_unprotect(PROTECT_ALL);
360 db_multi_exec("VACUUM");
361 db_protect_pop();
362 fossil_print("\nproject-id: %s\n", db_get("project-code", 0));
363 fossil_print("server-id: %s\n", db_get("server-code", 0));
364 zPassword = db_text(0, "SELECT pw FROM user WHERE login=%Q", g.zLogin);
365 fossil_print("admin-user: %s (password is \"%s\")\n", g.zLogin, zPassword);
366 hash_user_password(g.zLogin);
367 if( zWorkDir!=0 && zWorkDir[0]!=0 && !noOpen ){
368 Blob cmd;
369 fossil_print("opening the new %s repository in directory %s...\n",
370 zRepo, zWorkDir);
371 blob_init(&cmd, 0, 0);
372 blob_append_escaped_arg(&cmd, g.nameOfExe, 1);
373 blob_append(&cmd, " open ", -1);
374 blob_append_escaped_arg(&cmd, zRepo, 1);
375 blob_append(&cmd, " --nosync --workdir ", -1);
376 blob_append_escaped_arg(&cmd, zWorkDir, 1);
377 if( allowNested ){
378 blob_append(&cmd, " --nested", -1);
379 }
380 fossil_system(blob_str(&cmd));
381 blob_reset(&cmd);
382 }
383 }
384 }
385
386 /*
387 ** If user chooses to use HTTP Authentication over unencrypted HTTP,
388

Keyboard Shortcuts

Open search /
Next entry (timeline) j
Previous entry (timeline) k
Open focused entry Enter
Show this help ?
Toggle theme Top nav button