Fossil SCM

If the clone is interrupted by the user this should constitute an error condition.

andybradford 2023-12-08 13:52 clone-resume
Commit 2c8ad9a417cd3076d4f334f03076326f78aca56036c1eb0b26708b3b72854bc2
2 files changed +7 -7 +4 -1
+7 -7
--- src/clone.c
+++ src/clone.c
@@ -288,14 +288,16 @@
288288
db_protect_pop();
289289
url_enable_proxy(0);
290290
clone_ssh_db_set_options();
291291
url_get_password_if_needed();
292292
g.xlinkClusterOnly = 1;
293
- while( nResumes++<3 && sync_interrupted()==0
294
- && (nErr = client_sync(syncFlags,CONFIGSET_ALL,0,0))
293
+ while( nResumes++<3 && (nErr = client_sync(syncFlags,CONFIGSET_ALL,0,0))
295294
){
296
- if( sync_interrupted() ) break;
295
+ if( sync_interrupted() ){
296
+ fossil_warning("clone was interrupted");
297
+ break;
298
+ }
297299
if( db_get_int("aux-clone-seqno",1)==1 ){
298300
fossil_fatal("server returned an error - clone aborted");
299301
}
300302
fossil_warning("cloning encountered errors, trying again.");
301303
sqlite3_sleep(500);
@@ -318,12 +320,10 @@
318320
fossil_fatal("clone resume from different server not allowed");
319321
}
320322
}
321323
if( nErr ){
322324
fossil_warning("server returned an error - clone incomplete");
323
- }else if( sync_interrupted()==1 ){
324
- fossil_warning("clone was interrupted");
325325
}else{
326326
db_unprotect(PROTECT_CONFIG);
327327
db_multi_exec(
328328
"DELETE FROM config WHERE name = 'aux-clone-seqno';"
329329
"DELETE FROM config WHERE name = 'aux-clone-code';"
@@ -336,13 +336,13 @@
336336
#if !defined(_WIN32)
337337
signal(SIGINT, SIG_DFL);
338338
#endif
339339
}
340340
if( db_exists("SELECT 1 FROM delta WHERE srcId IN phantom") ){
341
+ fossil_warning("there are unresolved deltas -");
341342
if( db_get_int("aux-clone-seqno",0)==0 ){
342
- fossil_fatal("there are unresolved deltas -"
343
- " the clone is probabaly incomplete and unusable.");
343
+ fossil_fatal("the clone is probabaly incomplete and unusable.");
344344
}
345345
}
346346
if( db_get_int("aux-clone-seqno",0)>1 ){
347347
fossil_warning("It may be possible to resume the"
348348
" clone by running the same command again.");
349349
--- src/clone.c
+++ src/clone.c
@@ -288,14 +288,16 @@
288 db_protect_pop();
289 url_enable_proxy(0);
290 clone_ssh_db_set_options();
291 url_get_password_if_needed();
292 g.xlinkClusterOnly = 1;
293 while( nResumes++<3 && sync_interrupted()==0
294 && (nErr = client_sync(syncFlags,CONFIGSET_ALL,0,0))
295 ){
296 if( sync_interrupted() ) break;
 
 
 
297 if( db_get_int("aux-clone-seqno",1)==1 ){
298 fossil_fatal("server returned an error - clone aborted");
299 }
300 fossil_warning("cloning encountered errors, trying again.");
301 sqlite3_sleep(500);
@@ -318,12 +320,10 @@
318 fossil_fatal("clone resume from different server not allowed");
319 }
320 }
321 if( nErr ){
322 fossil_warning("server returned an error - clone incomplete");
323 }else if( sync_interrupted()==1 ){
324 fossil_warning("clone was interrupted");
325 }else{
326 db_unprotect(PROTECT_CONFIG);
327 db_multi_exec(
328 "DELETE FROM config WHERE name = 'aux-clone-seqno';"
329 "DELETE FROM config WHERE name = 'aux-clone-code';"
@@ -336,13 +336,13 @@
336 #if !defined(_WIN32)
337 signal(SIGINT, SIG_DFL);
338 #endif
339 }
340 if( db_exists("SELECT 1 FROM delta WHERE srcId IN phantom") ){
 
341 if( db_get_int("aux-clone-seqno",0)==0 ){
342 fossil_fatal("there are unresolved deltas -"
343 " the clone is probabaly incomplete and unusable.");
344 }
345 }
346 if( db_get_int("aux-clone-seqno",0)>1 ){
347 fossil_warning("It may be possible to resume the"
348 " clone by running the same command again.");
349
--- src/clone.c
+++ src/clone.c
@@ -288,14 +288,16 @@
288 db_protect_pop();
289 url_enable_proxy(0);
290 clone_ssh_db_set_options();
291 url_get_password_if_needed();
292 g.xlinkClusterOnly = 1;
293 while( nResumes++<3 && (nErr = client_sync(syncFlags,CONFIGSET_ALL,0,0))
 
294 ){
295 if( sync_interrupted() ){
296 fossil_warning("clone was interrupted");
297 break;
298 }
299 if( db_get_int("aux-clone-seqno",1)==1 ){
300 fossil_fatal("server returned an error - clone aborted");
301 }
302 fossil_warning("cloning encountered errors, trying again.");
303 sqlite3_sleep(500);
@@ -318,12 +320,10 @@
320 fossil_fatal("clone resume from different server not allowed");
321 }
322 }
323 if( nErr ){
324 fossil_warning("server returned an error - clone incomplete");
 
 
325 }else{
326 db_unprotect(PROTECT_CONFIG);
327 db_multi_exec(
328 "DELETE FROM config WHERE name = 'aux-clone-seqno';"
329 "DELETE FROM config WHERE name = 'aux-clone-code';"
@@ -336,13 +336,13 @@
336 #if !defined(_WIN32)
337 signal(SIGINT, SIG_DFL);
338 #endif
339 }
340 if( db_exists("SELECT 1 FROM delta WHERE srcId IN phantom") ){
341 fossil_warning("there are unresolved deltas -");
342 if( db_get_int("aux-clone-seqno",0)==0 ){
343 fossil_fatal("the clone is probabaly incomplete and unusable.");
 
344 }
345 }
346 if( db_get_int("aux-clone-seqno",0)>1 ){
347 fossil_warning("It may be possible to resume the"
348 " clone by running the same command again.");
349
+4 -1
--- src/xfer.c
+++ src/xfer.c
@@ -2910,11 +2910,14 @@
29102910
/* Continue the clone until we see the clone_seqno 0" card or
29112911
** until we stop receiving artifacts */
29122912
go = 1;
29132913
}
29142914
}
2915
- if( go && bSyncGotIntr ) go = 0;
2915
+ if( go && bSyncGotIntr ){
2916
+ go = 0;
2917
+ nErr++;
2918
+ }
29162919
29172920
nCardRcvd = 0;
29182921
xfer.nFileRcvd = 0;
29192922
xfer.nDeltaRcvd = 0;
29202923
xfer.nDanglingFile = 0;
29212924
--- src/xfer.c
+++ src/xfer.c
@@ -2910,11 +2910,14 @@
2910 /* Continue the clone until we see the clone_seqno 0" card or
2911 ** until we stop receiving artifacts */
2912 go = 1;
2913 }
2914 }
2915 if( go && bSyncGotIntr ) go = 0;
 
 
 
2916
2917 nCardRcvd = 0;
2918 xfer.nFileRcvd = 0;
2919 xfer.nDeltaRcvd = 0;
2920 xfer.nDanglingFile = 0;
2921
--- src/xfer.c
+++ src/xfer.c
@@ -2910,11 +2910,14 @@
2910 /* Continue the clone until we see the clone_seqno 0" card or
2911 ** until we stop receiving artifacts */
2912 go = 1;
2913 }
2914 }
2915 if( go && bSyncGotIntr ){
2916 go = 0;
2917 nErr++;
2918 }
2919
2920 nCardRcvd = 0;
2921 xfer.nFileRcvd = 0;
2922 xfer.nDeltaRcvd = 0;
2923 xfer.nDanglingFile = 0;
2924

Keyboard Shortcuts

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