Fossil SCM

Limit the scope to the error condition to clone operations only for now.

andybradford 2023-12-08 15:30 clone-resume
Commit 29e9e84a1ea9a8a63d16af8826f8f5f12d2945e7c983bcfea88f7b96298d90a6
2 files changed +3 -3 +3 -3
+3 -3
--- src/clone.c
+++ src/clone.c
@@ -290,17 +290,17 @@
290290
clone_ssh_db_set_options();
291291
url_get_password_if_needed();
292292
g.xlinkClusterOnly = 1;
293293
while( nResumes++<3 && (nErr = client_sync(syncFlags,CONFIGSET_ALL,0,0))
294294
){
295
+ if( db_get_int("aux-clone-seqno",1)==1 ){
296
+ fossil_fatal("server returned an error - clone aborted");
297
+ }
295298
if( sync_interrupted() ){
296299
fossil_warning("clone was interrupted");
297300
break;
298301
}
299
- if( db_get_int("aux-clone-seqno",1)==1 ){
300
- fossil_fatal("server returned an error - clone aborted");
301
- }
302302
if( nResumes<3 ){
303303
fossil_warning("cloning encountered errors, trying again.");
304304
sqlite3_sleep(500);
305305
}
306306
}
307307
--- src/clone.c
+++ src/clone.c
@@ -290,17 +290,17 @@
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 if( nResumes<3 ){
303 fossil_warning("cloning encountered errors, trying again.");
304 sqlite3_sleep(500);
305 }
306 }
307
--- src/clone.c
+++ src/clone.c
@@ -290,17 +290,17 @@
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( db_get_int("aux-clone-seqno",1)==1 ){
296 fossil_fatal("server returned an error - clone aborted");
297 }
298 if( sync_interrupted() ){
299 fossil_warning("clone was interrupted");
300 break;
301 }
 
 
 
302 if( nResumes<3 ){
303 fossil_warning("cloning encountered errors, trying again.");
304 sqlite3_sleep(500);
305 }
306 }
307
+3 -3
--- src/xfer.c
+++ src/xfer.c
@@ -2035,11 +2035,11 @@
20352035
return 0; /* Nothing to do */
20362036
}
20372037
20382038
if( (syncFlags & SYNC_CLONE)==0 && db_get_int("aux-clone-seqno",0)>0 ){
20392039
fossil_fatal("Unable to synchronize due to incomplete clone.");
2040
- }else{
2040
+ }else if( (syncFlags & SYNC_CLONE)!=0 ){
20412041
cloneSeqno = db_get_int("aux-clone-seqno",1);
20422042
}
20432043
20442044
/* Compute an appropriate project code. zPCode is the project code
20452045
** for the local repository. zAltPCode will usually be NULL, but might
@@ -2127,11 +2127,11 @@
21272127
** or push message.
21282128
*/
21292129
blob_appendf(&send, "pragma client-version %d %d %d\n",
21302130
RELEASE_VERSION_NUMBER, MANIFEST_NUMERIC_DATE,
21312131
MANIFEST_NUMERIC_TIME);
2132
- if( syncFlags & SYNC_CLONE ){
2132
+ if( (syncFlags & SYNC_CLONE)!=0 ){
21332133
#if !defined(_WIN32)
21342134
signal(SIGINT, sync_sigint_handler);
21352135
#endif
21362136
if( nCycle<2 ){
21372137
/* Only request this at the beginning of the clone */
@@ -2910,11 +2910,11 @@
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 ){
2915
+ if( (syncFlags & SYNC_CLONE)!=0 && bSyncGotIntr && cloneSeqno>0 ){
29162916
go = 0;
29172917
nErr++;
29182918
}
29192919
29202920
nCardRcvd = 0;
29212921
--- src/xfer.c
+++ src/xfer.c
@@ -2035,11 +2035,11 @@
2035 return 0; /* Nothing to do */
2036 }
2037
2038 if( (syncFlags & SYNC_CLONE)==0 && db_get_int("aux-clone-seqno",0)>0 ){
2039 fossil_fatal("Unable to synchronize due to incomplete clone.");
2040 }else{
2041 cloneSeqno = db_get_int("aux-clone-seqno",1);
2042 }
2043
2044 /* Compute an appropriate project code. zPCode is the project code
2045 ** for the local repository. zAltPCode will usually be NULL, but might
@@ -2127,11 +2127,11 @@
2127 ** or push message.
2128 */
2129 blob_appendf(&send, "pragma client-version %d %d %d\n",
2130 RELEASE_VERSION_NUMBER, MANIFEST_NUMERIC_DATE,
2131 MANIFEST_NUMERIC_TIME);
2132 if( syncFlags & SYNC_CLONE ){
2133 #if !defined(_WIN32)
2134 signal(SIGINT, sync_sigint_handler);
2135 #endif
2136 if( nCycle<2 ){
2137 /* Only request this at the beginning of the clone */
@@ -2910,11 +2910,11 @@
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
--- src/xfer.c
+++ src/xfer.c
@@ -2035,11 +2035,11 @@
2035 return 0; /* Nothing to do */
2036 }
2037
2038 if( (syncFlags & SYNC_CLONE)==0 && db_get_int("aux-clone-seqno",0)>0 ){
2039 fossil_fatal("Unable to synchronize due to incomplete clone.");
2040 }else if( (syncFlags & SYNC_CLONE)!=0 ){
2041 cloneSeqno = db_get_int("aux-clone-seqno",1);
2042 }
2043
2044 /* Compute an appropriate project code. zPCode is the project code
2045 ** for the local repository. zAltPCode will usually be NULL, but might
@@ -2127,11 +2127,11 @@
2127 ** or push message.
2128 */
2129 blob_appendf(&send, "pragma client-version %d %d %d\n",
2130 RELEASE_VERSION_NUMBER, MANIFEST_NUMERIC_DATE,
2131 MANIFEST_NUMERIC_TIME);
2132 if( (syncFlags & SYNC_CLONE)!=0 ){
2133 #if !defined(_WIN32)
2134 signal(SIGINT, sync_sigint_handler);
2135 #endif
2136 if( nCycle<2 ){
2137 /* Only request this at the beginning of the clone */
@@ -2910,11 +2910,11 @@
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( (syncFlags & SYNC_CLONE)!=0 && bSyncGotIntr && cloneSeqno>0 ){
2916 go = 0;
2917 nErr++;
2918 }
2919
2920 nCardRcvd = 0;
2921

Keyboard Shortcuts

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