Many hyperlinks are disabled.
Use anonymous login
to enable hyperlinks.
Overview
| Comment: | Merge wideAnnotateUser and jsonWarnings into trunk. |
|---|---|
| Downloads: | Tarball | ZIP archive |
| Timelines: | family | ancestors | descendants | both | trunk |
| Files: | files | file ages | folders |
| SHA1: |
18dd383e5e7684ecee327d3de7d3ff84 |
| User & Date: | drh 2012-02-24 13:40:10.539 |
Context
|
2012-02-25
| ||
| 15:31 | Update to the [/doc/trunk/www/stats.wiki | Stats] document. ... (check-in: affb0019c9 user: drh tags: trunk) | |
|
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) | |
Changes
Changes to src/diff.c.
| ︙ | ︙ | |||
1773 1774 1775 1776 1777 1778 1779 |
while( db_step(&q)==SQLITE_ROW ){
int pid = db_column_int(&q, 0);
const char *zUuid = db_column_text(&q, 1);
const char *zDate = db_column_text(&q, 2);
const char *zUser = db_column_text(&q, 3);
if( webLabel ){
zLabel = mprintf(
| | | | 1773 1774 1775 1776 1777 1778 1779 1780 1781 1782 1783 1784 1785 1786 1787 1788 1789 1790 1791 |
while( db_step(&q)==SQLITE_ROW ){
int pid = db_column_int(&q, 0);
const char *zUuid = db_column_text(&q, 1);
const char *zDate = db_column_text(&q, 2);
const char *zUser = db_column_text(&q, 3);
if( webLabel ){
zLabel = mprintf(
"<a href='%s/info/%s' target='infowindow'>%.10s</a> %s %13.13s",
g.zTop, zUuid, zUuid, zDate, zUser
);
}else{
zLabel = mprintf("%.10s %s %13.13s", zUuid, zDate, zUser);
}
p->nVers++;
p->azVers = fossil_realloc(p->azVers, p->nVers*sizeof(p->azVers[0]) );
p->azVers[p->nVers-1] = zLabel;
content_get(pid, &step);
annotation_step(p, &step, zLabel);
blob_reset(&step);
|
| ︙ | ︙ |
Changes to src/json.c.
| ︙ | ︙ | |||
82 83 84 85 86 87 88 |
/*
** Print the timing results.
*/
static double endTimer(void){
struct rusage sEnd;
getrusage(RUSAGE_SELF, &sEnd);
| < < > > | 82 83 84 85 86 87 88 89 90 91 92 93 94 95 96 97 98 99 100 101 102 |
/*
** Print the timing results.
*/
static double endTimer(void){
struct rusage sEnd;
getrusage(RUSAGE_SELF, &sEnd);
#if 0
printf("CPU Time: user %f sys %f\n",
timeDiff(&sBegin.ru_utime, &sEnd.ru_utime),
timeDiff(&sBegin.ru_stime, &sEnd.ru_stime));
#endif
return timeDiff(&sBegin.ru_utime, &sEnd.ru_utime)
+ timeDiff(&sBegin.ru_stime, &sEnd.ru_stime);
}
#define BEGIN_TIMER beginTimer()
#define END_TIMER endTimer()
#define HAS_TIMER 1
#elif (defined(_WIN32) || defined(WIN32))
|
| ︙ | ︙ | |||
160 161 162 163 164 165 166 167 168 169 170 171 172 173 |
static double endTimer(void){
if(getProcessTimesAddr){
FILETIME ftCreation, ftExit, ftKernelEnd, ftUserEnd;
getProcessTimesAddr(hProcess, &ftCreation, &ftExit, &ftKernelEnd, &ftUserEnd);
return timeDiff(&ftUserBegin, &ftUserEnd) +
timeDiff(&ftKernelBegin, &ftKernelEnd);
}
}
#define BEGIN_TIMER beginTimer()
#define END_TIMER endTimer()
#define HAS_TIMER hasTimer()
#else
| > | 160 161 162 163 164 165 166 167 168 169 170 171 172 173 174 |
static double endTimer(void){
if(getProcessTimesAddr){
FILETIME ftCreation, ftExit, ftKernelEnd, ftUserEnd;
getProcessTimesAddr(hProcess, &ftCreation, &ftExit, &ftKernelEnd, &ftUserEnd);
return timeDiff(&ftUserBegin, &ftUserEnd) +
timeDiff(&ftKernelBegin, &ftKernelEnd);
}
return 0.0;
}
#define BEGIN_TIMER beginTimer()
#define END_TIMER endTimer()
#define HAS_TIMER hasTimer()
#else
|
| ︙ | ︙ | |||
910 911 912 913 914 915 916 |
char separator,
char doDeHttp,
cson_array * target ){
char const * p = zStr /* current byte */;
char const * head /* current start-of-token */;
unsigned int len = 0 /* current token's length */;
int rc = 0 /* return code (number of added elements)*/;
| < | 911 912 913 914 915 916 917 918 919 920 921 922 923 924 |
char separator,
char doDeHttp,
cson_array * target ){
char const * p = zStr /* current byte */;
char const * head /* current start-of-token */;
unsigned int len = 0 /* current token's length */;
int rc = 0 /* return code (number of added elements)*/;
assert( zStr && target );
while( fossil_isspace(*p) ){
++p;
}
head = p;
for( ; ; ++p){
if( !*p || (separator == *p) ){
|
| ︙ | ︙ | |||
1013 1014 1015 1016 1017 1018 1019 |
** before they do any work.
**
** This must only be called once, or an assertion may be triggered.
*/
static void json_mode_bootstrap(){
static char once = 0 /* guard against multiple runs */;
char const * zPath = P("PATH_INFO");
| < | 1013 1014 1015 1016 1017 1018 1019 1020 1021 1022 1023 1024 1025 1026 |
** before they do any work.
**
** This must only be called once, or an assertion may be triggered.
*/
static void json_mode_bootstrap(){
static char once = 0 /* guard against multiple runs */;
char const * zPath = P("PATH_INFO");
assert( (0==once) && "json_mode_bootstrap() called too many times!");
if( once ){
return;
}else{
once = 1;
}
g.json.isJsonMode = 1;
|
| ︙ | ︙ | |||
1149 1150 1151 1152 1153 1154 1155 |
}
if(!g.isHTTP){
g.json.errorDetailParanoia = 0 /*disable error code dumb-down for CLI mode*/;
}
{/* set up JSON output formatting options. */
int indent = -1;
| < | 1148 1149 1150 1151 1152 1153 1154 1155 1156 1157 1158 1159 1160 1161 |
}
if(!g.isHTTP){
g.json.errorDetailParanoia = 0 /*disable error code dumb-down for CLI mode*/;
}
{/* set up JSON output formatting options. */
int indent = -1;
indent = json_find_option_int("indent",NULL,"I",-1);
g.json.outOpt.indentation = (0>indent)
? (g.isHTTP ? 0 : 1)
: (unsigned char)indent;
g.json.outOpt.addNewline = g.isHTTP
? 0
: (g.json.jsonp ? 0 : 1);
|
| ︙ | ︙ | |||
1329 1330 1331 1332 1333 1334 1335 |
*/
static cson_value * json_response_command_path(){
if(!g.json.cmd.a){
return NULL;
}else{
cson_value * rc = NULL;
Blob path = empty_blob;
| < | 1327 1328 1329 1330 1331 1332 1333 1334 1335 1336 1337 1338 1339 1340 |
*/
static cson_value * json_response_command_path(){
if(!g.json.cmd.a){
return NULL;
}else{
cson_value * rc = NULL;
Blob path = empty_blob;
unsigned int aLen = g.json.dispatchDepth+1; /*cson_array_length_get(g.json.cmd.a);*/
unsigned int i = 1;
for( ; i < aLen; ++i ){
char const * part = cson_string_cstr(cson_value_get_string(cson_array_get(g.json.cmd.a, i)));
if(!part){
fossil_warning("Iterating further than expected in %s.",
__FILE__);
|
| ︙ | ︙ |
Changes to src/json_artifact.c.
| ︙ | ︙ | |||
83 84 85 86 87 88 89 |
" AND event.objid=%d",
rid, rid
);
if( db_step(&q)==SQLITE_ROW ){
cson_object * o;
cson_value * tmpV = NULL;
const char *zUuid = db_column_text(&q, 0);
| < | 83 84 85 86 87 88 89 90 91 92 93 94 95 96 |
" AND event.objid=%d",
rid, rid
);
if( db_step(&q)==SQLITE_ROW ){
cson_object * o;
cson_value * tmpV = NULL;
const char *zUuid = db_column_text(&q, 0);
const char *zUser;
const char *zComment;
char * zEUser, * zEComment;
int mtime, omtime;
v = cson_value_new_object();
o = cson_value_get_object(v);
#define SET(K,V) cson_object_set(o,(K), (V))
|
| ︙ | ︙ |
Changes to src/json_diff.c.
| ︙ | ︙ | |||
35 36 37 38 39 40 41 |
cson_value * json_generate_diff(const char *zFrom, const char *zTo,
int nContext, char fSbs){
int fromid;
int toid;
int outLen;
Blob from = empty_blob, to = empty_blob, out = empty_blob;
cson_value * rc = NULL;
| < | 35 36 37 38 39 40 41 42 43 44 45 46 47 48 |
cson_value * json_generate_diff(const char *zFrom, const char *zTo,
int nContext, char fSbs){
int fromid;
int toid;
int outLen;
Blob from = empty_blob, to = empty_blob, out = empty_blob;
cson_value * rc = NULL;
int flags = (DIFF_CONTEXT_MASK & nContext)
| (fSbs ? DIFF_SIDEBYSIDE : 0);
fromid = name_to_typed_rid(zFrom, "*");
if(fromid<=0){
json_set_err(FSL_JSON_E_UNRESOLVED_UUID,
"Could not resolve 'from' ID.");
return NULL;
|
| ︙ | ︙ |
Changes to src/json_timeline.c.
| ︙ | ︙ | |||
403 404 405 406 407 408 409 |
}
}
cson_value_free( cson_string_value(tags) );
cson_value_free( cson_string_value(isLeaf) );
}
goto end;
| | | 403 404 405 406 407 408 409 410 411 412 413 414 415 416 417 |
}
}
cson_value_free( cson_string_value(tags) );
cson_value_free( cson_string_value(isLeaf) );
}
goto end;
assert( 0 != g.json.resultCode );
cson_value_free(pay);
end:
return pay;
}
|
| ︙ | ︙ | |||
427 428 429 430 431 432 433 | cson_value * tmp = NULL; cson_value * listV = NULL; cson_array * list = NULL; int check = 0; char showFiles = -1/*magic number*/; Stmt q = empty_Stmt; char warnRowToJsonFailed = 0; | < | 427 428 429 430 431 432 433 434 435 436 437 438 439 440 |
cson_value * tmp = NULL;
cson_value * listV = NULL;
cson_array * list = NULL;
int check = 0;
char showFiles = -1/*magic number*/;
Stmt q = empty_Stmt;
char warnRowToJsonFailed = 0;
Blob sql = empty_blob;
if( !g.perm.Read ){
/* IMO this falls more under the category of g.perm.History, but
i'm following the original timeline impl here.
*/
json_set_err( FSL_JSON_E_DENIED, "Checkin timeline requires 'o' access." );
return NULL;
|
| ︙ | ︙ |
Changes to src/json_wiki.c.
| ︙ | ︙ | |||
161 162 163 164 165 166 167 |
}
/*
** Implementation of /json/wiki/get.
**
*/
static cson_value * json_wiki_get(){
| < < < < < | 161 162 163 164 165 166 167 168 169 170 171 172 173 174 175 176 177 |
}
/*
** Implementation of /json/wiki/get.
**
*/
static cson_value * json_wiki_get(){
char const * zPageName;
char const * zFormat = NULL;
char contentFormat = -1;
if( !g.perm.RdWiki && !g.perm.Read ){
json_set_err(FSL_JSON_E_DENIED,
"Requires 'o' or 'j' access.");
return NULL;
}
zPageName = json_find_option_cstr("name",NULL,"n")
/* Damn... fossil automatically sets name to the PATH
|
| ︙ | ︙ |