Fossil SCM

Fix "fossil clean --test" not to remove files.

jan.nijtmans 2013-03-12 15:30 trunk
Commit 1c8efa5cabec9cecaa5cc70517f713b12989c4fd
1 file changed +2 -1
+2 -1
--- src/checkin.c
+++ src/checkin.c
@@ -424,10 +424,11 @@
424424
filename_collation());
425425
n = strlen(g.zLocalRoot);
426426
blob_init(&path, g.zLocalRoot, n-1);
427427
pIgnore = glob_create(zIgnoreFlag);
428428
vfile_scan(&path, blob_size(&path), scanFlags, pIgnore);
429
+ glob_free(pIgnore);
429430
db_prepare(&q,
430431
"SELECT %Q || x FROM sfile"
431432
" WHERE x NOT IN (%s)"
432433
" ORDER BY 1",
433434
g.zLocalRoot, fossil_all_reserved_names(0)
@@ -437,10 +438,11 @@
437438
}
438439
db_multi_exec("DELETE FROM sfile WHERE x IN (SELECT pathname FROM vfile)");
439440
while( db_step(&q)==SQLITE_ROW ){
440441
if( testFlag ){
441442
fossil_print("%s\n", db_column_text(&q,0));
443
+ continue;
442444
}else if( !allFlag ){
443445
Blob ans;
444446
char cReply;
445447
char *prompt = mprintf("remove unmanaged file \"%s\" (a=all/y/N)? ",
446448
db_column_text(&q, 0));
@@ -453,11 +455,10 @@
453455
continue;
454456
}
455457
}
456458
file_delete(db_column_text(&q, 0));
457459
}
458
- glob_free(pIgnore);
459460
db_finalize(&q);
460461
}
461462
462463
/*
463464
** Prompt the user for a check-in or stash comment (given in pPrompt),
464465
--- src/checkin.c
+++ src/checkin.c
@@ -424,10 +424,11 @@
424 filename_collation());
425 n = strlen(g.zLocalRoot);
426 blob_init(&path, g.zLocalRoot, n-1);
427 pIgnore = glob_create(zIgnoreFlag);
428 vfile_scan(&path, blob_size(&path), scanFlags, pIgnore);
 
429 db_prepare(&q,
430 "SELECT %Q || x FROM sfile"
431 " WHERE x NOT IN (%s)"
432 " ORDER BY 1",
433 g.zLocalRoot, fossil_all_reserved_names(0)
@@ -437,10 +438,11 @@
437 }
438 db_multi_exec("DELETE FROM sfile WHERE x IN (SELECT pathname FROM vfile)");
439 while( db_step(&q)==SQLITE_ROW ){
440 if( testFlag ){
441 fossil_print("%s\n", db_column_text(&q,0));
 
442 }else if( !allFlag ){
443 Blob ans;
444 char cReply;
445 char *prompt = mprintf("remove unmanaged file \"%s\" (a=all/y/N)? ",
446 db_column_text(&q, 0));
@@ -453,11 +455,10 @@
453 continue;
454 }
455 }
456 file_delete(db_column_text(&q, 0));
457 }
458 glob_free(pIgnore);
459 db_finalize(&q);
460 }
461
462 /*
463 ** Prompt the user for a check-in or stash comment (given in pPrompt),
464
--- src/checkin.c
+++ src/checkin.c
@@ -424,10 +424,11 @@
424 filename_collation());
425 n = strlen(g.zLocalRoot);
426 blob_init(&path, g.zLocalRoot, n-1);
427 pIgnore = glob_create(zIgnoreFlag);
428 vfile_scan(&path, blob_size(&path), scanFlags, pIgnore);
429 glob_free(pIgnore);
430 db_prepare(&q,
431 "SELECT %Q || x FROM sfile"
432 " WHERE x NOT IN (%s)"
433 " ORDER BY 1",
434 g.zLocalRoot, fossil_all_reserved_names(0)
@@ -437,10 +438,11 @@
438 }
439 db_multi_exec("DELETE FROM sfile WHERE x IN (SELECT pathname FROM vfile)");
440 while( db_step(&q)==SQLITE_ROW ){
441 if( testFlag ){
442 fossil_print("%s\n", db_column_text(&q,0));
443 continue;
444 }else if( !allFlag ){
445 Blob ans;
446 char cReply;
447 char *prompt = mprintf("remove unmanaged file \"%s\" (a=all/y/N)? ",
448 db_column_text(&q, 0));
@@ -453,11 +455,10 @@
455 continue;
456 }
457 }
458 file_delete(db_column_text(&q, 0));
459 }
 
460 db_finalize(&q);
461 }
462
463 /*
464 ** Prompt the user for a check-in or stash comment (given in pPrompt),
465

Keyboard Shortcuts

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