150
151
152
153
154
155
156
157
158
159
160
161
162
163
|
int nResumes = 0;
int urlFlags = URL_PROMPT_PW | URL_REMEMBER;
int syncFlags = SYNC_CLONE;
int noCompress = find_option("nocompress",0,0)!=0;
int noOpen = find_option("no-open",0,0)!=0;
int allowNested = find_option("nested",0,0)!=0; /* Used by open */
int bResume = 0; /* Set if a previous clone failed */
const char *zRepo = 0; /* Name of the new local repository file */
const char *zWorkDir = 0; /* Open in this directory, if not zero */
/* Also clone private branches */
if( find_option("private",0,0)!=0 ) syncFlags |= SYNC_PRIVATE;
if( find_option("once",0,0)!=0) urlFlags &= ~URL_REMEMBER;
|
>
>
|
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
|
int nResumes = 0;
int urlFlags = URL_PROMPT_PW | URL_REMEMBER;
int syncFlags = SYNC_CLONE;
int noCompress = find_option("nocompress",0,0)!=0;
int noOpen = find_option("no-open",0,0)!=0;
int allowNested = find_option("nested",0,0)!=0; /* Used by open */
int bResume = 0; /* Set if a previous clone failed */
const char *zNewProjCode; /* New Project code obtained during clone */
const char *zOldProjCode; /* Old project code stored in resuming clone */
const char *zRepo = 0; /* Name of the new local repository file */
const char *zWorkDir = 0; /* Open in this directory, if not zero */
/* Also clone private branches */
if( find_option("private",0,0)!=0 ) syncFlags |= SYNC_PRIVATE;
if( find_option("once",0,0)!=0) urlFlags &= ~URL_REMEMBER;
|
237
238
239
240
241
242
243
244
245
246
247
248
249
250
|
}else{
db_close_config();
if( bResume ){
db_open_repository(zRepo);
db_open_config(0,0);
db_begin_transaction();
db_unprotect(PROTECT_CONFIG);
db_multi_exec(
"DELETE FROM config WHERE name = 'project-code';"
"DELETE FROM config WHERE name = 'server-code';"
);
db_protect_pop();
db_initial_setup(0, 0, zDefaultUser);
user_select();
|
>
>
|
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
|
}else{
db_close_config();
if( bResume ){
db_open_repository(zRepo);
db_open_config(0,0);
db_begin_transaction();
db_unprotect(PROTECT_CONFIG);
zOldProjCode = db_get("project-code",0);
fossil_print("Resuming clone of project-id %s\n",zOldProjCode);
db_multi_exec(
"DELETE FROM config WHERE name = 'project-code';"
"DELETE FROM config WHERE name = 'server-code';"
);
db_protect_pop();
db_initial_setup(0, 0, zDefaultUser);
user_select();
|
300
301
302
303
304
305
306
307
308
309
310
311
312
313
314
315
|
}else if( sync_interrupted()==1 ){
fossil_warning("clone was interrupted");
}else{
db_unprotect(PROTECT_CONFIG);
db_multi_exec("DELETE FROM config WHERE name = 'aux-clone-seqno';");
db_protect_pop();
}
db_end_transaction(0);
db_close(1);
db_open_repository(zRepo);
#if !defined(_WIN32)
signal(SIGINT, SIG_DFL);
#endif
}
db_begin_transaction();
if( db_exists("SELECT 1 FROM delta WHERE srcId IN phantom") ){
|
>
>
>
>
>
>
>
>
>
|
|
>
|
304
305
306
307
308
309
310
311
312
313
314
315
316
317
318
319
320
321
322
323
324
325
326
327
328
329
|
}else if( sync_interrupted()==1 ){
fossil_warning("clone was interrupted");
}else{
db_unprotect(PROTECT_CONFIG);
db_multi_exec("DELETE FROM config WHERE name = 'aux-clone-seqno';");
db_protect_pop();
}
zNewProjCode = db_get("project-code",0);
if( bResume && zOldProjCode && zOldProjCode[0]
&& fossil_strcmp(zOldProjCode, zNewProjCode)!=0 ){
fossil_warning("project-id changed\nwas %s\nis %s\nrolling back changes",
zOldProjCode, zNewProjCode);
db_end_transaction(1);
db_close(1);
fossil_exit(1);
}else{
db_end_transaction(0);
db_close(1);
}
db_open_repository(zRepo);
#if !defined(_WIN32)
signal(SIGINT, SIG_DFL);
#endif
}
db_begin_transaction();
if( db_exists("SELECT 1 FROM delta WHERE srcId IN phantom") ){
|