Fossil SCM

Change a few instances of file_isdir() to file_wd_isdir().

dmitry 2011-09-27 19:15 trunk
Commit f1329470c033c748901044390071f056f11e1d03
3 files changed +2 -2 +2 -2 +2 -2
+2 -2
--- src/add.c
+++ src/add.c
@@ -228,11 +228,11 @@
228228
int isDir;
229229
Blob fullName;
230230
231231
file_canonical_name(g.argv[i], &fullName);
232232
zName = blob_str(&fullName);
233
- isDir = file_isdir(zName);
233
+ isDir = file_wd_isdir(zName);
234234
if( isDir==1 ){
235235
vfile_scan(&fullName, nRoot-1, includeDotFiles, pIgnore);
236236
}else if( isDir==0 ){
237237
fossil_fatal("not found: %s", zName);
238238
}else if( file_access(zName, R_OK) ){
@@ -506,11 +506,11 @@
506506
"UPDATE vfile SET origname=pathname WHERE origname IS NULL;"
507507
);
508508
db_multi_exec(
509509
"CREATE TEMP TABLE mv(f TEXT UNIQUE ON CONFLICT IGNORE, t TEXT);"
510510
);
511
- if( file_isdir(zDest)!=1 ){
511
+ if( file_wd_isdir(zDest)!=1 ){
512512
Blob orig;
513513
if( g.argc!=4 ){
514514
usage("OLDNAME NEWNAME");
515515
}
516516
file_tree_name(g.argv[2], &orig, 1);
517517
--- 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 @@
302302
blob_zero(&sql);
303303
blob_append(&sql, "DELETE FROM fv WHERE ", -1);
304304
zSep = "";
305305
for(i=3; i<g.argc; i++){
306306
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 ){
308308
if( blob_size(&treename) != 1 || blob_str(&treename)[0] != '.' ){
309309
blob_appendf(&sql, "%sfn NOT GLOB '%b/*' ", zSep, &treename);
310310
}else{
311311
blob_reset(&sql);
312312
break;
@@ -513,11 +513,11 @@
513513
514514
blob_zero(&path);
515515
blob_appendf(&path, "%s/%s", g.zLocalRoot, zDir);
516516
zPath = blob_str(&path);
517517
/* Handle various cases of existence of the directory */
518
- switch( file_isdir(zPath) ){
518
+ switch( file_wd_isdir(zPath) ){
519519
case 0: { /* doesn't exist */
520520
if( file_mkdir(zPath, 0)!=0 ) {
521521
fossil_warning("couldn't create directory %s as "
522522
"required by empty-dirs setting", zDir);
523523
}
524524
--- 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 @@
272272
blob_reset(&content);
273273
continue;
274274
}
275275
}
276276
if( verbose ) fossil_print("%s\n", &zName[nRepos]);
277
- if( file_isdir(zName) == 1 ){
277
+ if( file_wd_isdir(zName) == 1 ){
278278
/*TODO(dchest): remove directories? */
279279
fossil_fatal("%s is directory, cannot overwrite\n", zName);
280280
}
281281
if( file_wd_size(zName)>=0 && (isLink || file_wd_islink(zName)) ){
282282
file_delete(zName);
@@ -389,11 +389,11 @@
389389
blob_appendf(pPath, "/%s", zUtf8);
390390
fossil_mbcs_free(zUtf8);
391391
zPath = blob_str(pPath);
392392
if( glob_match(pIgnore, &zPath[nPrefix+1]) ){
393393
/* do nothing */
394
- }else if( file_isdir(zPath)==1 ){
394
+ }else if( file_wd_isdir(zPath)==1 ){
395395
if( !vfile_top_of_checkout(zPath) ){
396396
vfile_scan(pPath, nPrefix, allFlag, pIgnore);
397397
}
398398
}else if( file_wd_isfile_or_link(zPath) ){
399399
db_bind_text(&ins, ":file", &zPath[nPrefix+1]);
400400
--- 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

Keyboard Shortcuts

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