Fossil SCM
If the clone is interrupted by the user this should constitute an error condition.
Commit
2c8ad9a417cd3076d4f334f03076326f78aca56036c1eb0b26708b3b72854bc2
Parent
e6da7f08c8d766f…
2 files changed
+7
-7
+4
-1
+7
-7
| --- src/clone.c | ||
| +++ src/clone.c | ||
| @@ -288,14 +288,16 @@ | ||
| 288 | 288 | db_protect_pop(); |
| 289 | 289 | url_enable_proxy(0); |
| 290 | 290 | clone_ssh_db_set_options(); |
| 291 | 291 | url_get_password_if_needed(); |
| 292 | 292 | 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)) | |
| 295 | 294 | ){ |
| 296 | - if( sync_interrupted() ) break; | |
| 295 | + if( sync_interrupted() ){ | |
| 296 | + fossil_warning("clone was interrupted"); | |
| 297 | + break; | |
| 298 | + } | |
| 297 | 299 | if( db_get_int("aux-clone-seqno",1)==1 ){ |
| 298 | 300 | fossil_fatal("server returned an error - clone aborted"); |
| 299 | 301 | } |
| 300 | 302 | fossil_warning("cloning encountered errors, trying again."); |
| 301 | 303 | sqlite3_sleep(500); |
| @@ -318,12 +320,10 @@ | ||
| 318 | 320 | fossil_fatal("clone resume from different server not allowed"); |
| 319 | 321 | } |
| 320 | 322 | } |
| 321 | 323 | if( nErr ){ |
| 322 | 324 | fossil_warning("server returned an error - clone incomplete"); |
| 323 | - }else if( sync_interrupted()==1 ){ | |
| 324 | - fossil_warning("clone was interrupted"); | |
| 325 | 325 | }else{ |
| 326 | 326 | db_unprotect(PROTECT_CONFIG); |
| 327 | 327 | db_multi_exec( |
| 328 | 328 | "DELETE FROM config WHERE name = 'aux-clone-seqno';" |
| 329 | 329 | "DELETE FROM config WHERE name = 'aux-clone-code';" |
| @@ -336,13 +336,13 @@ | ||
| 336 | 336 | #if !defined(_WIN32) |
| 337 | 337 | signal(SIGINT, SIG_DFL); |
| 338 | 338 | #endif |
| 339 | 339 | } |
| 340 | 340 | if( db_exists("SELECT 1 FROM delta WHERE srcId IN phantom") ){ |
| 341 | + fossil_warning("there are unresolved deltas -"); | |
| 341 | 342 | 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."); | |
| 344 | 344 | } |
| 345 | 345 | } |
| 346 | 346 | if( db_get_int("aux-clone-seqno",0)>1 ){ |
| 347 | 347 | fossil_warning("It may be possible to resume the" |
| 348 | 348 | " clone by running the same command again."); |
| 349 | 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 && 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 @@ | ||
| 2910 | 2910 | /* Continue the clone until we see the clone_seqno 0" card or |
| 2911 | 2911 | ** until we stop receiving artifacts */ |
| 2912 | 2912 | go = 1; |
| 2913 | 2913 | } |
| 2914 | 2914 | } |
| 2915 | - if( go && bSyncGotIntr ) go = 0; | |
| 2915 | + if( go && bSyncGotIntr ){ | |
| 2916 | + go = 0; | |
| 2917 | + nErr++; | |
| 2918 | + } | |
| 2916 | 2919 | |
| 2917 | 2920 | nCardRcvd = 0; |
| 2918 | 2921 | xfer.nFileRcvd = 0; |
| 2919 | 2922 | xfer.nDeltaRcvd = 0; |
| 2920 | 2923 | xfer.nDanglingFile = 0; |
| 2921 | 2924 |
| --- 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 |