Many hyperlinks are disabled.
Use anonymous login
to enable hyperlinks.
Changes In Branch jsonWarnings Excluding Merge-Ins
This is equivalent to a diff from 3a44f95f40 to 86f6e675eb
2012-02-24
| ||
13:40 | Merge wideAnnotateUser and jsonWarnings into trunk. check-in: 18dd383e5e user: drh tags: trunk | |
11:36 | For annotate, make the fixed user name field wider (e.g. 'Administrator'). Closed-Leaf check-in: dbf4ecf414 user: mistachkin tags: wideAnnotateUser | |
2012-02-23
| ||
11:32 | Fix warnings in json support code (unused variables, unused label, etc). Closed-Leaf check-in: 86f6e675eb user: mistachkin tags: jsonWarnings | |
2012-02-21
| ||
02:01 | Make sure the "fossil rebuild" command always ends up showing "100.0% complete", not "99.9%" or "100.1%". check-in: 3a44f95f40 user: drh tags: trunk | |
01:53 | Enhance the "fossil rebuild" command so that it looks at "private" --raw tags and rebuilds the PRIVATE table to contain (at least) the content that is tagged "private". check-in: 2f98f66031 user: drh tags: trunk | |
Changes to src/json.c.
82 82 83 83 /* 84 84 ** Print the timing results. 85 85 */ 86 86 static double endTimer(void){ 87 87 struct rusage sEnd; 88 88 getrusage(RUSAGE_SELF, &sEnd); 89 - return timeDiff(&sBegin.ru_utime, &sEnd.ru_utime) 90 - + timeDiff(&sBegin.ru_stime, &sEnd.ru_stime); 91 89 #if 0 92 90 printf("CPU Time: user %f sys %f\n", 93 91 timeDiff(&sBegin.ru_utime, &sEnd.ru_utime), 94 92 timeDiff(&sBegin.ru_stime, &sEnd.ru_stime)); 95 93 #endif 94 + return timeDiff(&sBegin.ru_utime, &sEnd.ru_utime) 95 + + timeDiff(&sBegin.ru_stime, &sEnd.ru_stime); 96 96 } 97 97 98 98 #define BEGIN_TIMER beginTimer() 99 99 #define END_TIMER endTimer() 100 100 #define HAS_TIMER 1 101 101 102 102 #elif (defined(_WIN32) || defined(WIN32)) ................................................................................ 160 160 static double endTimer(void){ 161 161 if(getProcessTimesAddr){ 162 162 FILETIME ftCreation, ftExit, ftKernelEnd, ftUserEnd; 163 163 getProcessTimesAddr(hProcess, &ftCreation, &ftExit, &ftKernelEnd, &ftUserEnd); 164 164 return timeDiff(&ftUserBegin, &ftUserEnd) + 165 165 timeDiff(&ftKernelBegin, &ftKernelEnd); 166 166 } 167 + return 0.0; 167 168 } 168 169 169 170 #define BEGIN_TIMER beginTimer() 170 171 #define END_TIMER endTimer() 171 172 #define HAS_TIMER hasTimer() 172 173 173 174 #else ................................................................................ 910 911 char separator, 911 912 char doDeHttp, 912 913 cson_array * target ){ 913 914 char const * p = zStr /* current byte */; 914 915 char const * head /* current start-of-token */; 915 916 unsigned int len = 0 /* current token's length */; 916 917 int rc = 0 /* return code (number of added elements)*/; 917 - char skipWs = fossil_isspace(separator) ? 0 : 1; 918 918 assert( zStr && target ); 919 919 while( fossil_isspace(*p) ){ 920 920 ++p; 921 921 } 922 922 head = p; 923 923 for( ; ; ++p){ 924 924 if( !*p || (separator == *p) ){ ................................................................................ 1013 1013 ** before they do any work. 1014 1014 ** 1015 1015 ** This must only be called once, or an assertion may be triggered. 1016 1016 */ 1017 1017 static void json_mode_bootstrap(){ 1018 1018 static char once = 0 /* guard against multiple runs */; 1019 1019 char const * zPath = P("PATH_INFO"); 1020 - cson_value * pathSplit = NULL; 1021 1020 assert( (0==once) && "json_mode_bootstrap() called too many times!"); 1022 1021 if( once ){ 1023 1022 return; 1024 1023 }else{ 1025 1024 once = 1; 1026 1025 } 1027 1026 g.json.isJsonMode = 1; ................................................................................ 1149 1148 } 1150 1149 if(!g.isHTTP){ 1151 1150 g.json.errorDetailParanoia = 0 /*disable error code dumb-down for CLI mode*/; 1152 1151 } 1153 1152 1154 1153 {/* set up JSON output formatting options. */ 1155 1154 int indent = -1; 1156 - char const * indentStr = NULL; 1157 1155 indent = json_find_option_int("indent",NULL,"I",-1); 1158 1156 g.json.outOpt.indentation = (0>indent) 1159 1157 ? (g.isHTTP ? 0 : 1) 1160 1158 : (unsigned char)indent; 1161 1159 g.json.outOpt.addNewline = g.isHTTP 1162 1160 ? 0 1163 1161 : (g.json.jsonp ? 0 : 1); ................................................................................ 1329 1327 */ 1330 1328 static cson_value * json_response_command_path(){ 1331 1329 if(!g.json.cmd.a){ 1332 1330 return NULL; 1333 1331 }else{ 1334 1332 cson_value * rc = NULL; 1335 1333 Blob path = empty_blob; 1336 - char const * part; 1337 1334 unsigned int aLen = g.json.dispatchDepth+1; /*cson_array_length_get(g.json.cmd.a);*/ 1338 1335 unsigned int i = 1; 1339 1336 for( ; i < aLen; ++i ){ 1340 1337 char const * part = cson_string_cstr(cson_value_get_string(cson_array_get(g.json.cmd.a, i))); 1341 1338 if(!part){ 1342 1339 fossil_warning("Iterating further than expected in %s.", 1343 1340 __FILE__);
Changes to src/json_artifact.c.
83 83 " AND event.objid=%d", 84 84 rid, rid 85 85 ); 86 86 if( db_step(&q)==SQLITE_ROW ){ 87 87 cson_object * o; 88 88 cson_value * tmpV = NULL; 89 89 const char *zUuid = db_column_text(&q, 0); 90 - char * zTmp; 91 90 const char *zUser; 92 91 const char *zComment; 93 92 char * zEUser, * zEComment; 94 93 int mtime, omtime; 95 94 v = cson_value_new_object(); 96 95 o = cson_value_get_object(v); 97 96 #define SET(K,V) cson_object_set(o,(K), (V))
Changes to src/json_diff.c.
35 35 cson_value * json_generate_diff(const char *zFrom, const char *zTo, 36 36 int nContext, char fSbs){ 37 37 int fromid; 38 38 int toid; 39 39 int outLen; 40 40 Blob from = empty_blob, to = empty_blob, out = empty_blob; 41 41 cson_value * rc = NULL; 42 - char const * zType = "ci"; 43 42 int flags = (DIFF_CONTEXT_MASK & nContext) 44 43 | (fSbs ? DIFF_SIDEBYSIDE : 0); 45 44 fromid = name_to_typed_rid(zFrom, "*"); 46 45 if(fromid<=0){ 47 46 json_set_err(FSL_JSON_E_UNRESOLVED_UUID, 48 47 "Could not resolve 'from' ID."); 49 48 return NULL;
Changes to src/json_timeline.c.
403 403 } 404 404 } 405 405 cson_value_free( cson_string_value(tags) ); 406 406 cson_value_free( cson_string_value(isLeaf) ); 407 407 } 408 408 409 409 goto end; 410 - error: 410 + 411 411 assert( 0 != g.json.resultCode ); 412 412 cson_value_free(pay); 413 413 414 414 end: 415 415 return pay; 416 416 } 417 417 ................................................................................ 427 427 cson_value * tmp = NULL; 428 428 cson_value * listV = NULL; 429 429 cson_array * list = NULL; 430 430 int check = 0; 431 431 char showFiles = -1/*magic number*/; 432 432 Stmt q = empty_Stmt; 433 433 char warnRowToJsonFailed = 0; 434 - char warnStringToArrayFailed = 0; 435 434 Blob sql = empty_blob; 436 435 if( !g.perm.Read ){ 437 436 /* IMO this falls more under the category of g.perm.History, but 438 437 i'm following the original timeline impl here. 439 438 */ 440 439 json_set_err( FSL_JSON_E_DENIED, "Checkin timeline requires 'o' access." ); 441 440 return NULL;
Changes to src/json_wiki.c.
161 161 } 162 162 163 163 /* 164 164 ** Implementation of /json/wiki/get. 165 165 ** 166 166 */ 167 167 static cson_value * json_wiki_get(){ 168 - int rid; 169 - Manifest *pWiki = 0; 170 - char const * zBody = NULL; 171 168 char const * zPageName; 172 169 char const * zFormat = NULL; 173 - char * zUuid = NULL; 174 170 char contentFormat = -1; 175 - Stmt q; 176 171 if( !g.perm.RdWiki && !g.perm.Read ){ 177 172 json_set_err(FSL_JSON_E_DENIED, 178 173 "Requires 'o' or 'j' access."); 179 174 return NULL; 180 175 } 181 176 zPageName = json_find_option_cstr("name",NULL,"n") 182 177 /* Damn... fossil automatically sets name to the PATH