Fossil SCM
Change a few instances of file_isdir() to file_wd_isdir().
Commit
f1329470c033c748901044390071f056f11e1d03
Parent
f25e5e53c473a87…
3 files changed
+2
-2
+2
-2
+2
-2
+2
-2
| --- src/add.c | ||
| +++ src/add.c | ||
| @@ -228,11 +228,11 @@ | ||
| 228 | 228 | int isDir; |
| 229 | 229 | Blob fullName; |
| 230 | 230 | |
| 231 | 231 | file_canonical_name(g.argv[i], &fullName); |
| 232 | 232 | zName = blob_str(&fullName); |
| 233 | - isDir = file_isdir(zName); | |
| 233 | + isDir = file_wd_isdir(zName); | |
| 234 | 234 | if( isDir==1 ){ |
| 235 | 235 | vfile_scan(&fullName, nRoot-1, includeDotFiles, pIgnore); |
| 236 | 236 | }else if( isDir==0 ){ |
| 237 | 237 | fossil_fatal("not found: %s", zName); |
| 238 | 238 | }else if( file_access(zName, R_OK) ){ |
| @@ -506,11 +506,11 @@ | ||
| 506 | 506 | "UPDATE vfile SET origname=pathname WHERE origname IS NULL;" |
| 507 | 507 | ); |
| 508 | 508 | db_multi_exec( |
| 509 | 509 | "CREATE TEMP TABLE mv(f TEXT UNIQUE ON CONFLICT IGNORE, t TEXT);" |
| 510 | 510 | ); |
| 511 | - if( file_isdir(zDest)!=1 ){ | |
| 511 | + if( file_wd_isdir(zDest)!=1 ){ | |
| 512 | 512 | Blob orig; |
| 513 | 513 | if( g.argc!=4 ){ |
| 514 | 514 | usage("OLDNAME NEWNAME"); |
| 515 | 515 | } |
| 516 | 516 | file_tree_name(g.argv[2], &orig, 1); |
| 517 | 517 |
| --- src/add.c | |
| +++ src/add.c | |
| @@ -228,11 +228,11 @@ | |
| 228 | int isDir; |
| 229 | Blob fullName; |
| 230 | |
| 231 | file_canonical_name(g.argv[i], &fullName); |
| 232 | zName = blob_str(&fullName); |
| 233 | isDir = file_isdir(zName); |
| 234 | if( isDir==1 ){ |
| 235 | vfile_scan(&fullName, nRoot-1, includeDotFiles, pIgnore); |
| 236 | }else if( isDir==0 ){ |
| 237 | fossil_fatal("not found: %s", zName); |
| 238 | }else if( file_access(zName, R_OK) ){ |
| @@ -506,11 +506,11 @@ | |
| 506 | "UPDATE vfile SET origname=pathname WHERE origname IS NULL;" |
| 507 | ); |
| 508 | db_multi_exec( |
| 509 | "CREATE TEMP TABLE mv(f TEXT UNIQUE ON CONFLICT IGNORE, t TEXT);" |
| 510 | ); |
| 511 | if( file_isdir(zDest)!=1 ){ |
| 512 | Blob orig; |
| 513 | if( g.argc!=4 ){ |
| 514 | usage("OLDNAME NEWNAME"); |
| 515 | } |
| 516 | file_tree_name(g.argv[2], &orig, 1); |
| 517 |
| --- src/add.c | |
| +++ src/add.c | |
| @@ -228,11 +228,11 @@ | |
| 228 | int isDir; |
| 229 | Blob fullName; |
| 230 | |
| 231 | file_canonical_name(g.argv[i], &fullName); |
| 232 | zName = blob_str(&fullName); |
| 233 | isDir = file_wd_isdir(zName); |
| 234 | if( isDir==1 ){ |
| 235 | vfile_scan(&fullName, nRoot-1, includeDotFiles, pIgnore); |
| 236 | }else if( isDir==0 ){ |
| 237 | fossil_fatal("not found: %s", zName); |
| 238 | }else if( file_access(zName, R_OK) ){ |
| @@ -506,11 +506,11 @@ | |
| 506 | "UPDATE vfile SET origname=pathname WHERE origname IS NULL;" |
| 507 | ); |
| 508 | db_multi_exec( |
| 509 | "CREATE TEMP TABLE mv(f TEXT UNIQUE ON CONFLICT IGNORE, t TEXT);" |
| 510 | ); |
| 511 | if( file_wd_isdir(zDest)!=1 ){ |
| 512 | Blob orig; |
| 513 | if( g.argc!=4 ){ |
| 514 | usage("OLDNAME NEWNAME"); |
| 515 | } |
| 516 | file_tree_name(g.argv[2], &orig, 1); |
| 517 |
+2
-2
| --- src/update.c | ||
| +++ src/update.c | ||
| @@ -302,11 +302,11 @@ | ||
| 302 | 302 | blob_zero(&sql); |
| 303 | 303 | blob_append(&sql, "DELETE FROM fv WHERE ", -1); |
| 304 | 304 | zSep = ""; |
| 305 | 305 | for(i=3; i<g.argc; i++){ |
| 306 | 306 | file_tree_name(g.argv[i], &treename, 1); |
| 307 | - if( file_isdir(g.argv[i])==1 ){ | |
| 307 | + if( file_wd_isdir(g.argv[i])==1 ){ | |
| 308 | 308 | if( blob_size(&treename) != 1 || blob_str(&treename)[0] != '.' ){ |
| 309 | 309 | blob_appendf(&sql, "%sfn NOT GLOB '%b/*' ", zSep, &treename); |
| 310 | 310 | }else{ |
| 311 | 311 | blob_reset(&sql); |
| 312 | 312 | break; |
| @@ -513,11 +513,11 @@ | ||
| 513 | 513 | |
| 514 | 514 | blob_zero(&path); |
| 515 | 515 | blob_appendf(&path, "%s/%s", g.zLocalRoot, zDir); |
| 516 | 516 | zPath = blob_str(&path); |
| 517 | 517 | /* Handle various cases of existence of the directory */ |
| 518 | - switch( file_isdir(zPath) ){ | |
| 518 | + switch( file_wd_isdir(zPath) ){ | |
| 519 | 519 | case 0: { /* doesn't exist */ |
| 520 | 520 | if( file_mkdir(zPath, 0)!=0 ) { |
| 521 | 521 | fossil_warning("couldn't create directory %s as " |
| 522 | 522 | "required by empty-dirs setting", zDir); |
| 523 | 523 | } |
| 524 | 524 |
| --- src/update.c | |
| +++ src/update.c | |
| @@ -302,11 +302,11 @@ | |
| 302 | blob_zero(&sql); |
| 303 | blob_append(&sql, "DELETE FROM fv WHERE ", -1); |
| 304 | zSep = ""; |
| 305 | for(i=3; i<g.argc; i++){ |
| 306 | file_tree_name(g.argv[i], &treename, 1); |
| 307 | if( file_isdir(g.argv[i])==1 ){ |
| 308 | if( blob_size(&treename) != 1 || blob_str(&treename)[0] != '.' ){ |
| 309 | blob_appendf(&sql, "%sfn NOT GLOB '%b/*' ", zSep, &treename); |
| 310 | }else{ |
| 311 | blob_reset(&sql); |
| 312 | break; |
| @@ -513,11 +513,11 @@ | |
| 513 | |
| 514 | blob_zero(&path); |
| 515 | blob_appendf(&path, "%s/%s", g.zLocalRoot, zDir); |
| 516 | zPath = blob_str(&path); |
| 517 | /* Handle various cases of existence of the directory */ |
| 518 | switch( file_isdir(zPath) ){ |
| 519 | case 0: { /* doesn't exist */ |
| 520 | if( file_mkdir(zPath, 0)!=0 ) { |
| 521 | fossil_warning("couldn't create directory %s as " |
| 522 | "required by empty-dirs setting", zDir); |
| 523 | } |
| 524 |
| --- src/update.c | |
| +++ src/update.c | |
| @@ -302,11 +302,11 @@ | |
| 302 | blob_zero(&sql); |
| 303 | blob_append(&sql, "DELETE FROM fv WHERE ", -1); |
| 304 | zSep = ""; |
| 305 | for(i=3; i<g.argc; i++){ |
| 306 | file_tree_name(g.argv[i], &treename, 1); |
| 307 | if( file_wd_isdir(g.argv[i])==1 ){ |
| 308 | if( blob_size(&treename) != 1 || blob_str(&treename)[0] != '.' ){ |
| 309 | blob_appendf(&sql, "%sfn NOT GLOB '%b/*' ", zSep, &treename); |
| 310 | }else{ |
| 311 | blob_reset(&sql); |
| 312 | break; |
| @@ -513,11 +513,11 @@ | |
| 513 | |
| 514 | blob_zero(&path); |
| 515 | blob_appendf(&path, "%s/%s", g.zLocalRoot, zDir); |
| 516 | zPath = blob_str(&path); |
| 517 | /* Handle various cases of existence of the directory */ |
| 518 | switch( file_wd_isdir(zPath) ){ |
| 519 | case 0: { /* doesn't exist */ |
| 520 | if( file_mkdir(zPath, 0)!=0 ) { |
| 521 | fossil_warning("couldn't create directory %s as " |
| 522 | "required by empty-dirs setting", zDir); |
| 523 | } |
| 524 |
+2
-2
| --- src/vfile.c | ||
| +++ src/vfile.c | ||
| @@ -272,11 +272,11 @@ | ||
| 272 | 272 | blob_reset(&content); |
| 273 | 273 | continue; |
| 274 | 274 | } |
| 275 | 275 | } |
| 276 | 276 | if( verbose ) fossil_print("%s\n", &zName[nRepos]); |
| 277 | - if( file_isdir(zName) == 1 ){ | |
| 277 | + if( file_wd_isdir(zName) == 1 ){ | |
| 278 | 278 | /*TODO(dchest): remove directories? */ |
| 279 | 279 | fossil_fatal("%s is directory, cannot overwrite\n", zName); |
| 280 | 280 | } |
| 281 | 281 | if( file_wd_size(zName)>=0 && (isLink || file_wd_islink(zName)) ){ |
| 282 | 282 | file_delete(zName); |
| @@ -389,11 +389,11 @@ | ||
| 389 | 389 | blob_appendf(pPath, "/%s", zUtf8); |
| 390 | 390 | fossil_mbcs_free(zUtf8); |
| 391 | 391 | zPath = blob_str(pPath); |
| 392 | 392 | if( glob_match(pIgnore, &zPath[nPrefix+1]) ){ |
| 393 | 393 | /* do nothing */ |
| 394 | - }else if( file_isdir(zPath)==1 ){ | |
| 394 | + }else if( file_wd_isdir(zPath)==1 ){ | |
| 395 | 395 | if( !vfile_top_of_checkout(zPath) ){ |
| 396 | 396 | vfile_scan(pPath, nPrefix, allFlag, pIgnore); |
| 397 | 397 | } |
| 398 | 398 | }else if( file_wd_isfile_or_link(zPath) ){ |
| 399 | 399 | db_bind_text(&ins, ":file", &zPath[nPrefix+1]); |
| 400 | 400 |
| --- src/vfile.c | |
| +++ src/vfile.c | |
| @@ -272,11 +272,11 @@ | |
| 272 | blob_reset(&content); |
| 273 | continue; |
| 274 | } |
| 275 | } |
| 276 | if( verbose ) fossil_print("%s\n", &zName[nRepos]); |
| 277 | if( file_isdir(zName) == 1 ){ |
| 278 | /*TODO(dchest): remove directories? */ |
| 279 | fossil_fatal("%s is directory, cannot overwrite\n", zName); |
| 280 | } |
| 281 | if( file_wd_size(zName)>=0 && (isLink || file_wd_islink(zName)) ){ |
| 282 | file_delete(zName); |
| @@ -389,11 +389,11 @@ | |
| 389 | blob_appendf(pPath, "/%s", zUtf8); |
| 390 | fossil_mbcs_free(zUtf8); |
| 391 | zPath = blob_str(pPath); |
| 392 | if( glob_match(pIgnore, &zPath[nPrefix+1]) ){ |
| 393 | /* do nothing */ |
| 394 | }else if( file_isdir(zPath)==1 ){ |
| 395 | if( !vfile_top_of_checkout(zPath) ){ |
| 396 | vfile_scan(pPath, nPrefix, allFlag, pIgnore); |
| 397 | } |
| 398 | }else if( file_wd_isfile_or_link(zPath) ){ |
| 399 | db_bind_text(&ins, ":file", &zPath[nPrefix+1]); |
| 400 |
| --- src/vfile.c | |
| +++ src/vfile.c | |
| @@ -272,11 +272,11 @@ | |
| 272 | blob_reset(&content); |
| 273 | continue; |
| 274 | } |
| 275 | } |
| 276 | if( verbose ) fossil_print("%s\n", &zName[nRepos]); |
| 277 | if( file_wd_isdir(zName) == 1 ){ |
| 278 | /*TODO(dchest): remove directories? */ |
| 279 | fossil_fatal("%s is directory, cannot overwrite\n", zName); |
| 280 | } |
| 281 | if( file_wd_size(zName)>=0 && (isLink || file_wd_islink(zName)) ){ |
| 282 | file_delete(zName); |
| @@ -389,11 +389,11 @@ | |
| 389 | blob_appendf(pPath, "/%s", zUtf8); |
| 390 | fossil_mbcs_free(zUtf8); |
| 391 | zPath = blob_str(pPath); |
| 392 | if( glob_match(pIgnore, &zPath[nPrefix+1]) ){ |
| 393 | /* do nothing */ |
| 394 | }else if( file_wd_isdir(zPath)==1 ){ |
| 395 | if( !vfile_top_of_checkout(zPath) ){ |
| 396 | vfile_scan(pPath, nPrefix, allFlag, pIgnore); |
| 397 | } |
| 398 | }else if( file_wd_isfile_or_link(zPath) ){ |
| 399 | db_bind_text(&ins, ":file", &zPath[nPrefix+1]); |
| 400 |