Fossil SCM
Use file_access(..., F_OK) in stead of file_access(zFullName, 0) everywhere, in case some platforms exist where F_OK != 0. Remove a few end-of-line spaces.
Commit
9df71fe36c00214e2602dbbd251fe2c8551cc538
Parent
7458a18894b8765…
5 files changed
+3
-3
+2
-2
+3
-3
+2
-2
+3
-3
+3
-3
| --- src/allrepo.c | ||
| +++ src/allrepo.c | ||
| @@ -155,11 +155,11 @@ | ||
| 155 | 155 | int dryRunFlag = 0; |
| 156 | 156 | int showFile = find_option("showfile",0,0)!=0; |
| 157 | 157 | int stopOnError = find_option("dontstop",0,0)==0; |
| 158 | 158 | int rc; |
| 159 | 159 | int nToDel = 0; |
| 160 | - | |
| 160 | + | |
| 161 | 161 | dryRunFlag = find_option("dry-run","n",0)!=0; |
| 162 | 162 | if( !dryRunFlag ){ |
| 163 | 163 | dryRunFlag = find_option("test",0,0)!=0; /* deprecated */ |
| 164 | 164 | } |
| 165 | 165 | |
| @@ -282,11 +282,11 @@ | ||
| 282 | 282 | ); |
| 283 | 283 | } |
| 284 | 284 | db_multi_exec("CREATE TEMP TABLE todel(x TEXT)"); |
| 285 | 285 | while( db_step(&q)==SQLITE_ROW ){ |
| 286 | 286 | const char *zFilename = db_column_text(&q, 0); |
| 287 | - if( file_access(zFilename, 0) | |
| 287 | + if( file_access(zFilename, F_OK) | |
| 288 | 288 | || !file_is_canonical(zFilename) |
| 289 | 289 | || (useCheckouts && file_isdir(zFilename)!=1) |
| 290 | 290 | ){ |
| 291 | 291 | db_multi_exec("INSERT INTO todel VALUES(%Q)", db_column_text(&q, 1)); |
| 292 | 292 | nToDel++; |
| @@ -312,11 +312,11 @@ | ||
| 312 | 312 | if( stopOnError && rc ){ |
| 313 | 313 | break; |
| 314 | 314 | } |
| 315 | 315 | } |
| 316 | 316 | db_finalize(&q); |
| 317 | - | |
| 317 | + | |
| 318 | 318 | /* If any repositories whose names appear in the ~/.fossil file could not |
| 319 | 319 | ** be found, remove those names from the ~/.fossil file. |
| 320 | 320 | */ |
| 321 | 321 | if( nToDel>0 ){ |
| 322 | 322 | const char *zSql = "DELETE FROM global_config WHERE name IN toDel"; |
| 323 | 323 |
| --- src/allrepo.c | |
| +++ src/allrepo.c | |
| @@ -155,11 +155,11 @@ | |
| 155 | int dryRunFlag = 0; |
| 156 | int showFile = find_option("showfile",0,0)!=0; |
| 157 | int stopOnError = find_option("dontstop",0,0)==0; |
| 158 | int rc; |
| 159 | int nToDel = 0; |
| 160 | |
| 161 | dryRunFlag = find_option("dry-run","n",0)!=0; |
| 162 | if( !dryRunFlag ){ |
| 163 | dryRunFlag = find_option("test",0,0)!=0; /* deprecated */ |
| 164 | } |
| 165 | |
| @@ -282,11 +282,11 @@ | |
| 282 | ); |
| 283 | } |
| 284 | db_multi_exec("CREATE TEMP TABLE todel(x TEXT)"); |
| 285 | while( db_step(&q)==SQLITE_ROW ){ |
| 286 | const char *zFilename = db_column_text(&q, 0); |
| 287 | if( file_access(zFilename, 0) |
| 288 | || !file_is_canonical(zFilename) |
| 289 | || (useCheckouts && file_isdir(zFilename)!=1) |
| 290 | ){ |
| 291 | db_multi_exec("INSERT INTO todel VALUES(%Q)", db_column_text(&q, 1)); |
| 292 | nToDel++; |
| @@ -312,11 +312,11 @@ | |
| 312 | if( stopOnError && rc ){ |
| 313 | break; |
| 314 | } |
| 315 | } |
| 316 | db_finalize(&q); |
| 317 | |
| 318 | /* If any repositories whose names appear in the ~/.fossil file could not |
| 319 | ** be found, remove those names from the ~/.fossil file. |
| 320 | */ |
| 321 | if( nToDel>0 ){ |
| 322 | const char *zSql = "DELETE FROM global_config WHERE name IN toDel"; |
| 323 |
| --- src/allrepo.c | |
| +++ src/allrepo.c | |
| @@ -155,11 +155,11 @@ | |
| 155 | int dryRunFlag = 0; |
| 156 | int showFile = find_option("showfile",0,0)!=0; |
| 157 | int stopOnError = find_option("dontstop",0,0)==0; |
| 158 | int rc; |
| 159 | int nToDel = 0; |
| 160 | |
| 161 | dryRunFlag = find_option("dry-run","n",0)!=0; |
| 162 | if( !dryRunFlag ){ |
| 163 | dryRunFlag = find_option("test",0,0)!=0; /* deprecated */ |
| 164 | } |
| 165 | |
| @@ -282,11 +282,11 @@ | |
| 282 | ); |
| 283 | } |
| 284 | db_multi_exec("CREATE TEMP TABLE todel(x TEXT)"); |
| 285 | while( db_step(&q)==SQLITE_ROW ){ |
| 286 | const char *zFilename = db_column_text(&q, 0); |
| 287 | if( file_access(zFilename, F_OK) |
| 288 | || !file_is_canonical(zFilename) |
| 289 | || (useCheckouts && file_isdir(zFilename)!=1) |
| 290 | ){ |
| 291 | db_multi_exec("INSERT INTO todel VALUES(%Q)", db_column_text(&q, 1)); |
| 292 | nToDel++; |
| @@ -312,11 +312,11 @@ | |
| 312 | if( stopOnError && rc ){ |
| 313 | break; |
| 314 | } |
| 315 | } |
| 316 | db_finalize(&q); |
| 317 | |
| 318 | /* If any repositories whose names appear in the ~/.fossil file could not |
| 319 | ** be found, remove those names from the ~/.fossil file. |
| 320 | */ |
| 321 | if( nToDel>0 ){ |
| 322 | const char *zSql = "DELETE FROM global_config WHERE name IN toDel"; |
| 323 |
+2
-2
| --- src/checkin.c | ||
| +++ src/checkin.c | ||
| @@ -86,11 +86,11 @@ | ||
| 86 | 86 | } |
| 87 | 87 | blob_append(report, zPrefix, nPrefix); |
| 88 | 88 | if( isDeleted ){ |
| 89 | 89 | blob_appendf(report, "DELETED %s\n", zDisplayName); |
| 90 | 90 | }else if( !file_wd_isfile_or_link(zFullName) ){ |
| 91 | - if( file_access(zFullName, 0)==0 ){ | |
| 91 | + if( file_access(zFullName, F_OK)==0 ){ | |
| 92 | 92 | blob_appendf(report, "NOT_A_FILE %s\n", zDisplayName); |
| 93 | 93 | if( missingIsFatal ){ |
| 94 | 94 | fossil_warning("not a file: %s", zDisplayName); |
| 95 | 95 | nErr++; |
| 96 | 96 | } |
| @@ -327,11 +327,11 @@ | ||
| 327 | 327 | if( isNew ){ |
| 328 | 328 | type = "ADDED "; |
| 329 | 329 | }else if( isDeleted ){ |
| 330 | 330 | type = "DELETED "; |
| 331 | 331 | }else if( !file_wd_isfile_or_link(zFullName) ){ |
| 332 | - if( file_access(zFullName, 0)==0 ){ | |
| 332 | + if( file_access(zFullName, F_OK)==0 ){ | |
| 333 | 333 | type = "NOT_A_FILE "; |
| 334 | 334 | }else{ |
| 335 | 335 | type = "MISSING "; |
| 336 | 336 | } |
| 337 | 337 | }else if( chnged ){ |
| 338 | 338 |
| --- src/checkin.c | |
| +++ src/checkin.c | |
| @@ -86,11 +86,11 @@ | |
| 86 | } |
| 87 | blob_append(report, zPrefix, nPrefix); |
| 88 | if( isDeleted ){ |
| 89 | blob_appendf(report, "DELETED %s\n", zDisplayName); |
| 90 | }else if( !file_wd_isfile_or_link(zFullName) ){ |
| 91 | if( file_access(zFullName, 0)==0 ){ |
| 92 | blob_appendf(report, "NOT_A_FILE %s\n", zDisplayName); |
| 93 | if( missingIsFatal ){ |
| 94 | fossil_warning("not a file: %s", zDisplayName); |
| 95 | nErr++; |
| 96 | } |
| @@ -327,11 +327,11 @@ | |
| 327 | if( isNew ){ |
| 328 | type = "ADDED "; |
| 329 | }else if( isDeleted ){ |
| 330 | type = "DELETED "; |
| 331 | }else if( !file_wd_isfile_or_link(zFullName) ){ |
| 332 | if( file_access(zFullName, 0)==0 ){ |
| 333 | type = "NOT_A_FILE "; |
| 334 | }else{ |
| 335 | type = "MISSING "; |
| 336 | } |
| 337 | }else if( chnged ){ |
| 338 |
| --- src/checkin.c | |
| +++ src/checkin.c | |
| @@ -86,11 +86,11 @@ | |
| 86 | } |
| 87 | blob_append(report, zPrefix, nPrefix); |
| 88 | if( isDeleted ){ |
| 89 | blob_appendf(report, "DELETED %s\n", zDisplayName); |
| 90 | }else if( !file_wd_isfile_or_link(zFullName) ){ |
| 91 | if( file_access(zFullName, F_OK)==0 ){ |
| 92 | blob_appendf(report, "NOT_A_FILE %s\n", zDisplayName); |
| 93 | if( missingIsFatal ){ |
| 94 | fossil_warning("not a file: %s", zDisplayName); |
| 95 | nErr++; |
| 96 | } |
| @@ -327,11 +327,11 @@ | |
| 327 | if( isNew ){ |
| 328 | type = "ADDED "; |
| 329 | }else if( isDeleted ){ |
| 330 | type = "DELETED "; |
| 331 | }else if( !file_wd_isfile_or_link(zFullName) ){ |
| 332 | if( file_access(zFullName, F_OK)==0 ){ |
| 333 | type = "NOT_A_FILE "; |
| 334 | }else{ |
| 335 | type = "MISSING "; |
| 336 | } |
| 337 | }else if( chnged ){ |
| 338 |
M
src/db.c
+3
-3
| --- src/db.c | ||
| +++ src/db.c | ||
| @@ -1004,11 +1004,11 @@ | ||
| 1004 | 1004 | if( zDbName==0 ){ |
| 1005 | 1005 | db_err("unable to find the name of a repository database"); |
| 1006 | 1006 | } |
| 1007 | 1007 | } |
| 1008 | 1008 | if( file_access(zDbName, R_OK) || file_size(zDbName)<1024 ){ |
| 1009 | - if( file_access(zDbName, 0) ){ | |
| 1009 | + if( file_access(zDbName, F_OK) ){ | |
| 1010 | 1010 | #ifdef FOSSIL_ENABLE_JSON |
| 1011 | 1011 | g.json.resultCode = FSL_JSON_E_DB_NOT_FOUND; |
| 1012 | 1012 | #endif |
| 1013 | 1013 | fossil_panic("repository does not exist or" |
| 1014 | 1014 | " is in an unreadable directory: %s", zDbName); |
| @@ -1138,11 +1138,11 @@ | ||
| 1138 | 1138 | if( g.argc!=3 ){ |
| 1139 | 1139 | usage("PATHNAME"); |
| 1140 | 1140 | } |
| 1141 | 1141 | file_canonical_name(g.argv[2], &repo, 0); |
| 1142 | 1142 | zRepo = blob_str(&repo); |
| 1143 | - if( file_access(zRepo, 0) ){ | |
| 1143 | + if( file_access(zRepo, F_OK) ){ | |
| 1144 | 1144 | fossil_fatal("no such file: %s", zRepo); |
| 1145 | 1145 | } |
| 1146 | 1146 | if( db_open_local(zRepo)==0 ){ |
| 1147 | 1147 | fossil_fatal("not in a local checkout"); |
| 1148 | 1148 | return; |
| @@ -2513,11 +2513,11 @@ | ||
| 2513 | 2513 | zOrigSql += j+6; |
| 2514 | 2514 | j = -1; |
| 2515 | 2515 | } |
| 2516 | 2516 | } |
| 2517 | 2517 | blob_append(&newSql, zOrigSql, -1); |
| 2518 | - blob_appendf(&allSql, | |
| 2518 | + blob_appendf(&allSql, | |
| 2519 | 2519 | "ALTER TABLE %s RENAME TO x_%s;\n" |
| 2520 | 2520 | "%s WITHOUT ROWID;\n" |
| 2521 | 2521 | "INSERT INTO %s SELECT * FROM x_%s;\n" |
| 2522 | 2522 | "DROP TABLE x_%s;\n", |
| 2523 | 2523 | zTName, zTName, blob_str(&newSql), zTName, zTName, zTName |
| 2524 | 2524 |
| --- src/db.c | |
| +++ src/db.c | |
| @@ -1004,11 +1004,11 @@ | |
| 1004 | if( zDbName==0 ){ |
| 1005 | db_err("unable to find the name of a repository database"); |
| 1006 | } |
| 1007 | } |
| 1008 | if( file_access(zDbName, R_OK) || file_size(zDbName)<1024 ){ |
| 1009 | if( file_access(zDbName, 0) ){ |
| 1010 | #ifdef FOSSIL_ENABLE_JSON |
| 1011 | g.json.resultCode = FSL_JSON_E_DB_NOT_FOUND; |
| 1012 | #endif |
| 1013 | fossil_panic("repository does not exist or" |
| 1014 | " is in an unreadable directory: %s", zDbName); |
| @@ -1138,11 +1138,11 @@ | |
| 1138 | if( g.argc!=3 ){ |
| 1139 | usage("PATHNAME"); |
| 1140 | } |
| 1141 | file_canonical_name(g.argv[2], &repo, 0); |
| 1142 | zRepo = blob_str(&repo); |
| 1143 | if( file_access(zRepo, 0) ){ |
| 1144 | fossil_fatal("no such file: %s", zRepo); |
| 1145 | } |
| 1146 | if( db_open_local(zRepo)==0 ){ |
| 1147 | fossil_fatal("not in a local checkout"); |
| 1148 | return; |
| @@ -2513,11 +2513,11 @@ | |
| 2513 | zOrigSql += j+6; |
| 2514 | j = -1; |
| 2515 | } |
| 2516 | } |
| 2517 | blob_append(&newSql, zOrigSql, -1); |
| 2518 | blob_appendf(&allSql, |
| 2519 | "ALTER TABLE %s RENAME TO x_%s;\n" |
| 2520 | "%s WITHOUT ROWID;\n" |
| 2521 | "INSERT INTO %s SELECT * FROM x_%s;\n" |
| 2522 | "DROP TABLE x_%s;\n", |
| 2523 | zTName, zTName, blob_str(&newSql), zTName, zTName, zTName |
| 2524 |
| --- src/db.c | |
| +++ src/db.c | |
| @@ -1004,11 +1004,11 @@ | |
| 1004 | if( zDbName==0 ){ |
| 1005 | db_err("unable to find the name of a repository database"); |
| 1006 | } |
| 1007 | } |
| 1008 | if( file_access(zDbName, R_OK) || file_size(zDbName)<1024 ){ |
| 1009 | if( file_access(zDbName, F_OK) ){ |
| 1010 | #ifdef FOSSIL_ENABLE_JSON |
| 1011 | g.json.resultCode = FSL_JSON_E_DB_NOT_FOUND; |
| 1012 | #endif |
| 1013 | fossil_panic("repository does not exist or" |
| 1014 | " is in an unreadable directory: %s", zDbName); |
| @@ -1138,11 +1138,11 @@ | |
| 1138 | if( g.argc!=3 ){ |
| 1139 | usage("PATHNAME"); |
| 1140 | } |
| 1141 | file_canonical_name(g.argv[2], &repo, 0); |
| 1142 | zRepo = blob_str(&repo); |
| 1143 | if( file_access(zRepo, F_OK) ){ |
| 1144 | fossil_fatal("no such file: %s", zRepo); |
| 1145 | } |
| 1146 | if( db_open_local(zRepo)==0 ){ |
| 1147 | fossil_fatal("not in a local checkout"); |
| 1148 | return; |
| @@ -2513,11 +2513,11 @@ | |
| 2513 | zOrigSql += j+6; |
| 2514 | j = -1; |
| 2515 | } |
| 2516 | } |
| 2517 | blob_append(&newSql, zOrigSql, -1); |
| 2518 | blob_appendf(&allSql, |
| 2519 | "ALTER TABLE %s RENAME TO x_%s;\n" |
| 2520 | "%s WITHOUT ROWID;\n" |
| 2521 | "INSERT INTO %s SELECT * FROM x_%s;\n" |
| 2522 | "DROP TABLE x_%s;\n", |
| 2523 | zTName, zTName, blob_str(&newSql), zTName, zTName, zTName |
| 2524 |
+2
-2
| --- src/diffcmd.c | ||
| +++ src/diffcmd.c | ||
| @@ -171,11 +171,11 @@ | ||
| 171 | 171 | ** zFile2 */ |
| 172 | 172 | blob_zero(&nameFile1); |
| 173 | 173 | do{ |
| 174 | 174 | blob_reset(&nameFile1); |
| 175 | 175 | blob_appendf(&nameFile1, "%s~%d", zFile2, cnt++); |
| 176 | - }while( file_access(blob_str(&nameFile1),0)==0 ); | |
| 176 | + }while( file_access(blob_str(&nameFile1),F_OK)==0 ); | |
| 177 | 177 | blob_write_to_file(pFile1, blob_str(&nameFile1)); |
| 178 | 178 | |
| 179 | 179 | /* Construct the external diff command */ |
| 180 | 180 | blob_zero(&cmd); |
| 181 | 181 | blob_appendf(&cmd, "%s ", zDiffCmd); |
| @@ -385,11 +385,11 @@ | ||
| 385 | 385 | char *zToFree = zFullName; |
| 386 | 386 | int showDiff = 1; |
| 387 | 387 | if( isDeleted ){ |
| 388 | 388 | fossil_print("DELETED %s\n", zPathname); |
| 389 | 389 | if( !asNewFile ){ showDiff = 0; zFullName = NULL_DEVICE; } |
| 390 | - }else if( file_access(zFullName, 0) ){ | |
| 390 | + }else if( file_access(zFullName, F_OK) ){ | |
| 391 | 391 | fossil_print("MISSING %s\n", zPathname); |
| 392 | 392 | if( !asNewFile ){ showDiff = 0; } |
| 393 | 393 | }else if( isNew ){ |
| 394 | 394 | fossil_print("ADDED %s\n", zPathname); |
| 395 | 395 | srcid = 0; |
| 396 | 396 |
| --- src/diffcmd.c | |
| +++ src/diffcmd.c | |
| @@ -171,11 +171,11 @@ | |
| 171 | ** zFile2 */ |
| 172 | blob_zero(&nameFile1); |
| 173 | do{ |
| 174 | blob_reset(&nameFile1); |
| 175 | blob_appendf(&nameFile1, "%s~%d", zFile2, cnt++); |
| 176 | }while( file_access(blob_str(&nameFile1),0)==0 ); |
| 177 | blob_write_to_file(pFile1, blob_str(&nameFile1)); |
| 178 | |
| 179 | /* Construct the external diff command */ |
| 180 | blob_zero(&cmd); |
| 181 | blob_appendf(&cmd, "%s ", zDiffCmd); |
| @@ -385,11 +385,11 @@ | |
| 385 | char *zToFree = zFullName; |
| 386 | int showDiff = 1; |
| 387 | if( isDeleted ){ |
| 388 | fossil_print("DELETED %s\n", zPathname); |
| 389 | if( !asNewFile ){ showDiff = 0; zFullName = NULL_DEVICE; } |
| 390 | }else if( file_access(zFullName, 0) ){ |
| 391 | fossil_print("MISSING %s\n", zPathname); |
| 392 | if( !asNewFile ){ showDiff = 0; } |
| 393 | }else if( isNew ){ |
| 394 | fossil_print("ADDED %s\n", zPathname); |
| 395 | srcid = 0; |
| 396 |
| --- src/diffcmd.c | |
| +++ src/diffcmd.c | |
| @@ -171,11 +171,11 @@ | |
| 171 | ** zFile2 */ |
| 172 | blob_zero(&nameFile1); |
| 173 | do{ |
| 174 | blob_reset(&nameFile1); |
| 175 | blob_appendf(&nameFile1, "%s~%d", zFile2, cnt++); |
| 176 | }while( file_access(blob_str(&nameFile1),F_OK)==0 ); |
| 177 | blob_write_to_file(pFile1, blob_str(&nameFile1)); |
| 178 | |
| 179 | /* Construct the external diff command */ |
| 180 | blob_zero(&cmd); |
| 181 | blob_appendf(&cmd, "%s ", zDiffCmd); |
| @@ -385,11 +385,11 @@ | |
| 385 | char *zToFree = zFullName; |
| 386 | int showDiff = 1; |
| 387 | if( isDeleted ){ |
| 388 | fossil_print("DELETED %s\n", zPathname); |
| 389 | if( !asNewFile ){ showDiff = 0; zFullName = NULL_DEVICE; } |
| 390 | }else if( file_access(zFullName, F_OK) ){ |
| 391 | fossil_print("MISSING %s\n", zPathname); |
| 392 | if( !asNewFile ){ showDiff = 0; } |
| 393 | }else if( isNew ){ |
| 394 | fossil_print("ADDED %s\n", zPathname); |
| 395 | srcid = 0; |
| 396 |
+3
-3
| --- src/json_status.c | ||
| +++ src/json_status.c | ||
| @@ -69,11 +69,11 @@ | ||
| 69 | 69 | zTmp = db_text(0, "SELECT uuid FROM blob WHERE rid=%d", vid); |
| 70 | 70 | cson_object_set(tmpO, "uuid", json_new_string(zTmp) ); |
| 71 | 71 | free(zTmp); |
| 72 | 72 | |
| 73 | 73 | cson_object_set( tmpO, "tags", json_tags_for_checkin_rid(vid, 0) ); |
| 74 | - | |
| 74 | + | |
| 75 | 75 | /* FIXME: optimize the datetime/timestamp queries into 1 query. */ |
| 76 | 76 | zTmp = db_text(0, "SELECT datetime(mtime) || " |
| 77 | 77 | "' UTC' FROM event WHERE objid=%d", |
| 78 | 78 | vid); |
| 79 | 79 | cson_object_set(tmpO, "datetime", json_new_string(zTmp)); |
| @@ -115,11 +115,11 @@ | ||
| 115 | 115 | zStatus = "new" /* maintenance reminder: MUST come |
| 116 | 116 | BEFORE the isChnged checks. */; |
| 117 | 117 | }else if( isRenamed ){ |
| 118 | 118 | zStatus = "renamed"; |
| 119 | 119 | }else if( !file_wd_isfile_or_link(zFullName) ){ |
| 120 | - if( file_access(zFullName, 0)==0 ){ | |
| 120 | + if( file_access(zFullName, F_OK)==0 ){ | |
| 121 | 121 | zStatus = "notAFile"; |
| 122 | 122 | ++nErr; |
| 123 | 123 | }else{ |
| 124 | 124 | zStatus = "missing"; |
| 125 | 125 | ++nErr; |
| @@ -137,11 +137,11 @@ | ||
| 137 | 137 | zStatus = "conflict"; |
| 138 | 138 | }else{ |
| 139 | 139 | zStatus = "edited"; |
| 140 | 140 | } |
| 141 | 141 | } |
| 142 | - | |
| 142 | + | |
| 143 | 143 | oFile = cson_new_object(); |
| 144 | 144 | cson_array_append( aFiles, cson_object_value(oFile) ); |
| 145 | 145 | /* optimization potential: move these keys into cson_strings |
| 146 | 146 | to take advantage of refcounting. */ |
| 147 | 147 | cson_object_set( oFile, "name", json_new_string( zPathname ) ); |
| 148 | 148 |
| --- src/json_status.c | |
| +++ src/json_status.c | |
| @@ -69,11 +69,11 @@ | |
| 69 | zTmp = db_text(0, "SELECT uuid FROM blob WHERE rid=%d", vid); |
| 70 | cson_object_set(tmpO, "uuid", json_new_string(zTmp) ); |
| 71 | free(zTmp); |
| 72 | |
| 73 | cson_object_set( tmpO, "tags", json_tags_for_checkin_rid(vid, 0) ); |
| 74 | |
| 75 | /* FIXME: optimize the datetime/timestamp queries into 1 query. */ |
| 76 | zTmp = db_text(0, "SELECT datetime(mtime) || " |
| 77 | "' UTC' FROM event WHERE objid=%d", |
| 78 | vid); |
| 79 | cson_object_set(tmpO, "datetime", json_new_string(zTmp)); |
| @@ -115,11 +115,11 @@ | |
| 115 | zStatus = "new" /* maintenance reminder: MUST come |
| 116 | BEFORE the isChnged checks. */; |
| 117 | }else if( isRenamed ){ |
| 118 | zStatus = "renamed"; |
| 119 | }else if( !file_wd_isfile_or_link(zFullName) ){ |
| 120 | if( file_access(zFullName, 0)==0 ){ |
| 121 | zStatus = "notAFile"; |
| 122 | ++nErr; |
| 123 | }else{ |
| 124 | zStatus = "missing"; |
| 125 | ++nErr; |
| @@ -137,11 +137,11 @@ | |
| 137 | zStatus = "conflict"; |
| 138 | }else{ |
| 139 | zStatus = "edited"; |
| 140 | } |
| 141 | } |
| 142 | |
| 143 | oFile = cson_new_object(); |
| 144 | cson_array_append( aFiles, cson_object_value(oFile) ); |
| 145 | /* optimization potential: move these keys into cson_strings |
| 146 | to take advantage of refcounting. */ |
| 147 | cson_object_set( oFile, "name", json_new_string( zPathname ) ); |
| 148 |
| --- src/json_status.c | |
| +++ src/json_status.c | |
| @@ -69,11 +69,11 @@ | |
| 69 | zTmp = db_text(0, "SELECT uuid FROM blob WHERE rid=%d", vid); |
| 70 | cson_object_set(tmpO, "uuid", json_new_string(zTmp) ); |
| 71 | free(zTmp); |
| 72 | |
| 73 | cson_object_set( tmpO, "tags", json_tags_for_checkin_rid(vid, 0) ); |
| 74 | |
| 75 | /* FIXME: optimize the datetime/timestamp queries into 1 query. */ |
| 76 | zTmp = db_text(0, "SELECT datetime(mtime) || " |
| 77 | "' UTC' FROM event WHERE objid=%d", |
| 78 | vid); |
| 79 | cson_object_set(tmpO, "datetime", json_new_string(zTmp)); |
| @@ -115,11 +115,11 @@ | |
| 115 | zStatus = "new" /* maintenance reminder: MUST come |
| 116 | BEFORE the isChnged checks. */; |
| 117 | }else if( isRenamed ){ |
| 118 | zStatus = "renamed"; |
| 119 | }else if( !file_wd_isfile_or_link(zFullName) ){ |
| 120 | if( file_access(zFullName, F_OK)==0 ){ |
| 121 | zStatus = "notAFile"; |
| 122 | ++nErr; |
| 123 | }else{ |
| 124 | zStatus = "missing"; |
| 125 | ++nErr; |
| @@ -137,11 +137,11 @@ | |
| 137 | zStatus = "conflict"; |
| 138 | }else{ |
| 139 | zStatus = "edited"; |
| 140 | } |
| 141 | } |
| 142 | |
| 143 | oFile = cson_new_object(); |
| 144 | cson_array_append( aFiles, cson_object_value(oFile) ); |
| 145 | /* optimization potential: move these keys into cson_strings |
| 146 | to take advantage of refcounting. */ |
| 147 | cson_object_set( oFile, "name", json_new_string( zPathname ) ); |
| 148 |