Fossil SCM
Add option --case-sensitive to "fossil delete". On case-insensitive filesystems now you can "fossil delete src/FOO.c", which results in src/foo.c being prepared from removal. This doesn't work yet for directories.
Commit
7ae19e56ba36cd30480ecf30a46e20726e662f3b
Parent
45675bdd924e7a6…
1 file changed
+12
-5
+12
-5
| --- src/add.c | ||
| +++ src/add.c | ||
| @@ -267,11 +267,12 @@ | ||
| 267 | 267 | vid = db_lget_int("checkout",0); |
| 268 | 268 | if( vid==0 ){ |
| 269 | 269 | fossil_panic("no checkout to add to"); |
| 270 | 270 | } |
| 271 | 271 | db_begin_transaction(); |
| 272 | - db_multi_exec("CREATE TEMP TABLE sfile(x TEXT PRIMARY KEY)"); | |
| 272 | + db_multi_exec("CREATE TEMP TABLE sfile(x TEXT PRIMARY KEY %s)", | |
| 273 | + filename_collation()); | |
| 273 | 274 | pClean = glob_create(zCleanFlag); |
| 274 | 275 | pIgnore = glob_create(zIgnoreFlag); |
| 275 | 276 | nRoot = strlen(g.zLocalRoot); |
| 276 | 277 | |
| 277 | 278 | /* Load the names of all files that are to be added into sfile temp table */ |
| @@ -316,37 +317,42 @@ | ||
| 316 | 317 | ** |
| 317 | 318 | ** This command does NOT remove the files from disk. It just marks the |
| 318 | 319 | ** files as no longer being part of the project. In other words, future |
| 319 | 320 | ** changes to the named files will not be versioned. |
| 320 | 321 | ** |
| 322 | +** Options: | |
| 323 | +** --case-sensitive <BOOL> override case-sensitive setting | |
| 324 | +** | |
| 321 | 325 | ** See also: addremove, add |
| 322 | 326 | */ |
| 323 | 327 | void delete_cmd(void){ |
| 324 | 328 | int i; |
| 325 | 329 | int vid; |
| 326 | 330 | Stmt loop; |
| 327 | 331 | |
| 332 | + capture_case_sensitive_option(); | |
| 328 | 333 | db_must_be_within_tree(); |
| 329 | 334 | vid = db_lget_int("checkout", 0); |
| 330 | 335 | if( vid==0 ){ |
| 331 | 336 | fossil_panic("no checkout to remove from"); |
| 332 | 337 | } |
| 333 | 338 | db_begin_transaction(); |
| 334 | - db_multi_exec("CREATE TEMP TABLE sfile(x TEXT PRIMARY KEY)"); | |
| 339 | + db_multi_exec("CREATE TEMP TABLE sfile(x TEXT PRIMARY KEY %s)", | |
| 340 | + filename_collation()); | |
| 335 | 341 | for(i=2; i<g.argc; i++){ |
| 336 | 342 | Blob treeName; |
| 337 | 343 | char *zTreeName; |
| 338 | 344 | |
| 339 | 345 | file_tree_name(g.argv[i], &treeName, 1); |
| 340 | 346 | zTreeName = blob_str(&treeName); |
| 341 | 347 | db_multi_exec( |
| 342 | 348 | "INSERT OR IGNORE INTO sfile" |
| 343 | 349 | " SELECT pathname FROM vfile" |
| 344 | - " WHERE (pathname=%Q" | |
| 350 | + " WHERE (pathname=%Q %s" | |
| 345 | 351 | " OR (pathname>'%q/' AND pathname<'%q0'))" |
| 346 | 352 | " AND NOT deleted", |
| 347 | - zTreeName, zTreeName, zTreeName | |
| 353 | + zTreeName, filename_collation(), zTreeName, zTreeName | |
| 348 | 354 | ); |
| 349 | 355 | blob_reset(&treeName); |
| 350 | 356 | } |
| 351 | 357 | |
| 352 | 358 | db_prepare(&loop, "SELECT x FROM sfile"); |
| @@ -509,11 +515,12 @@ | ||
| 509 | 515 | ** Populate the temp table "sfile" with the names of all unmanaged |
| 510 | 516 | ** files currently in the check-out, except for files that match the |
| 511 | 517 | ** --ignore or ignore-glob patterns and dot-files. Then add all of |
| 512 | 518 | ** the files in the sfile temp table to the set of managed files. |
| 513 | 519 | */ |
| 514 | - db_multi_exec("CREATE TEMP TABLE sfile(x TEXT PRIMARY KEY)"); | |
| 520 | + db_multi_exec("CREATE TEMP TABLE sfile(x TEXT PRIMARY KEY %s)", | |
| 521 | + filename_collation()); | |
| 515 | 522 | n = strlen(g.zLocalRoot); |
| 516 | 523 | blob_init(&path, g.zLocalRoot, n-1); |
| 517 | 524 | /* now we read the complete file structure into a temp table */ |
| 518 | 525 | pClean = glob_create(zCleanFlag); |
| 519 | 526 | pIgnore = glob_create(zIgnoreFlag); |
| 520 | 527 |
| --- src/add.c | |
| +++ src/add.c | |
| @@ -267,11 +267,12 @@ | |
| 267 | vid = db_lget_int("checkout",0); |
| 268 | if( vid==0 ){ |
| 269 | fossil_panic("no checkout to add to"); |
| 270 | } |
| 271 | db_begin_transaction(); |
| 272 | db_multi_exec("CREATE TEMP TABLE sfile(x TEXT PRIMARY KEY)"); |
| 273 | pClean = glob_create(zCleanFlag); |
| 274 | pIgnore = glob_create(zIgnoreFlag); |
| 275 | nRoot = strlen(g.zLocalRoot); |
| 276 | |
| 277 | /* Load the names of all files that are to be added into sfile temp table */ |
| @@ -316,37 +317,42 @@ | |
| 316 | ** |
| 317 | ** This command does NOT remove the files from disk. It just marks the |
| 318 | ** files as no longer being part of the project. In other words, future |
| 319 | ** changes to the named files will not be versioned. |
| 320 | ** |
| 321 | ** See also: addremove, add |
| 322 | */ |
| 323 | void delete_cmd(void){ |
| 324 | int i; |
| 325 | int vid; |
| 326 | Stmt loop; |
| 327 | |
| 328 | db_must_be_within_tree(); |
| 329 | vid = db_lget_int("checkout", 0); |
| 330 | if( vid==0 ){ |
| 331 | fossil_panic("no checkout to remove from"); |
| 332 | } |
| 333 | db_begin_transaction(); |
| 334 | db_multi_exec("CREATE TEMP TABLE sfile(x TEXT PRIMARY KEY)"); |
| 335 | for(i=2; i<g.argc; i++){ |
| 336 | Blob treeName; |
| 337 | char *zTreeName; |
| 338 | |
| 339 | file_tree_name(g.argv[i], &treeName, 1); |
| 340 | zTreeName = blob_str(&treeName); |
| 341 | db_multi_exec( |
| 342 | "INSERT OR IGNORE INTO sfile" |
| 343 | " SELECT pathname FROM vfile" |
| 344 | " WHERE (pathname=%Q" |
| 345 | " OR (pathname>'%q/' AND pathname<'%q0'))" |
| 346 | " AND NOT deleted", |
| 347 | zTreeName, zTreeName, zTreeName |
| 348 | ); |
| 349 | blob_reset(&treeName); |
| 350 | } |
| 351 | |
| 352 | db_prepare(&loop, "SELECT x FROM sfile"); |
| @@ -509,11 +515,12 @@ | |
| 509 | ** Populate the temp table "sfile" with the names of all unmanaged |
| 510 | ** files currently in the check-out, except for files that match the |
| 511 | ** --ignore or ignore-glob patterns and dot-files. Then add all of |
| 512 | ** the files in the sfile temp table to the set of managed files. |
| 513 | */ |
| 514 | db_multi_exec("CREATE TEMP TABLE sfile(x TEXT PRIMARY KEY)"); |
| 515 | n = strlen(g.zLocalRoot); |
| 516 | blob_init(&path, g.zLocalRoot, n-1); |
| 517 | /* now we read the complete file structure into a temp table */ |
| 518 | pClean = glob_create(zCleanFlag); |
| 519 | pIgnore = glob_create(zIgnoreFlag); |
| 520 |
| --- src/add.c | |
| +++ src/add.c | |
| @@ -267,11 +267,12 @@ | |
| 267 | vid = db_lget_int("checkout",0); |
| 268 | if( vid==0 ){ |
| 269 | fossil_panic("no checkout to add to"); |
| 270 | } |
| 271 | db_begin_transaction(); |
| 272 | db_multi_exec("CREATE TEMP TABLE sfile(x TEXT PRIMARY KEY %s)", |
| 273 | filename_collation()); |
| 274 | pClean = glob_create(zCleanFlag); |
| 275 | pIgnore = glob_create(zIgnoreFlag); |
| 276 | nRoot = strlen(g.zLocalRoot); |
| 277 | |
| 278 | /* Load the names of all files that are to be added into sfile temp table */ |
| @@ -316,37 +317,42 @@ | |
| 317 | ** |
| 318 | ** This command does NOT remove the files from disk. It just marks the |
| 319 | ** files as no longer being part of the project. In other words, future |
| 320 | ** changes to the named files will not be versioned. |
| 321 | ** |
| 322 | ** Options: |
| 323 | ** --case-sensitive <BOOL> override case-sensitive setting |
| 324 | ** |
| 325 | ** See also: addremove, add |
| 326 | */ |
| 327 | void delete_cmd(void){ |
| 328 | int i; |
| 329 | int vid; |
| 330 | Stmt loop; |
| 331 | |
| 332 | capture_case_sensitive_option(); |
| 333 | db_must_be_within_tree(); |
| 334 | vid = db_lget_int("checkout", 0); |
| 335 | if( vid==0 ){ |
| 336 | fossil_panic("no checkout to remove from"); |
| 337 | } |
| 338 | db_begin_transaction(); |
| 339 | db_multi_exec("CREATE TEMP TABLE sfile(x TEXT PRIMARY KEY %s)", |
| 340 | filename_collation()); |
| 341 | for(i=2; i<g.argc; i++){ |
| 342 | Blob treeName; |
| 343 | char *zTreeName; |
| 344 | |
| 345 | file_tree_name(g.argv[i], &treeName, 1); |
| 346 | zTreeName = blob_str(&treeName); |
| 347 | db_multi_exec( |
| 348 | "INSERT OR IGNORE INTO sfile" |
| 349 | " SELECT pathname FROM vfile" |
| 350 | " WHERE (pathname=%Q %s" |
| 351 | " OR (pathname>'%q/' AND pathname<'%q0'))" |
| 352 | " AND NOT deleted", |
| 353 | zTreeName, filename_collation(), zTreeName, zTreeName |
| 354 | ); |
| 355 | blob_reset(&treeName); |
| 356 | } |
| 357 | |
| 358 | db_prepare(&loop, "SELECT x FROM sfile"); |
| @@ -509,11 +515,12 @@ | |
| 515 | ** Populate the temp table "sfile" with the names of all unmanaged |
| 516 | ** files currently in the check-out, except for files that match the |
| 517 | ** --ignore or ignore-glob patterns and dot-files. Then add all of |
| 518 | ** the files in the sfile temp table to the set of managed files. |
| 519 | */ |
| 520 | db_multi_exec("CREATE TEMP TABLE sfile(x TEXT PRIMARY KEY %s)", |
| 521 | filename_collation()); |
| 522 | n = strlen(g.zLocalRoot); |
| 523 | blob_init(&path, g.zLocalRoot, n-1); |
| 524 | /* now we read the complete file structure into a temp table */ |
| 525 | pClean = glob_create(zCleanFlag); |
| 526 | pIgnore = glob_create(zIgnoreFlag); |
| 527 |