Fossil SCM
Remove some tabs and end-of-line whitespace
Commit
bf9669f55e5fee98d8425e9dc5d090c5c481fddc
Parent
63ed4b00f3d1561…
22 files changed
+3
-4
+3
-4
+1
-1
+1
-1
+1
-1
+7
-7
+4
-4
+1
-1
+2
-2
+1
-1
+2
-2
+6
-6
+6
-6
+8
-8
+1
-1
+1
-1
+1
-1
+1
-1
+2
-2
+1
-1
+1
-1
+1
-1
~
ajax/index.html
~
ajax/wiki-editor.html
~
src/codecheck1.c
~
src/export.c
~
src/finfo.c
~
src/json_artifact.c
~
src/json_branch.c
~
src/json_diff.c
~
src/json_finfo.c
~
src/json_login.c
~
src/json_report.c
~
src/json_tag.c
~
src/json_user.c
~
src/json_wiki.c
~
src/main.c
~
src/makeheaders.html
~
src/printf.c
~
test/diff-test-1.wiki
~
test/merge1.test
~
test/merge3.test
~
test/merge5.test
~
test/revert.test
+3
-4
| --- ajax/index.html | ||
| +++ ajax/index.html | ||
| @@ -1,12 +1,11 @@ | ||
| 1 | -<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN" | |
| 2 | - "http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd"> | |
| 1 | +<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd"> | |
| 3 | 2 | <html xmlns="http://www.w3.org/1999/xhtml" xml:lang="en" lang="en"> |
| 4 | 3 | |
| 5 | 4 | <head> |
| 6 | - <title>Fossil/JSON raw request sending</title> | |
| 7 | - <meta http-equiv="content-type" content="text/html;charset=utf-8" /> | |
| 5 | + <title>Fossil/JSON raw request sending</title> | |
| 6 | + <meta http-equiv="content-type" content="text/html;charset=utf-8" /> | |
| 8 | 7 | <script type="text/javascript" src="http://ajax.googleapis.com/ajax/libs/jquery/1.6.4/jquery.min.js"></script> |
| 9 | 8 | <script type="text/javascript" src="js/whajaj.js"></script> |
| 10 | 9 | <script type="text/javascript" src="js/fossil-ajaj.js"></script> |
| 11 | 10 | |
| 12 | 11 | <style type='text/css'> |
| 13 | 12 |
| --- ajax/index.html | |
| +++ ajax/index.html | |
| @@ -1,12 +1,11 @@ | |
| 1 | <!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN" |
| 2 | "http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd"> |
| 3 | <html xmlns="http://www.w3.org/1999/xhtml" xml:lang="en" lang="en"> |
| 4 | |
| 5 | <head> |
| 6 | <title>Fossil/JSON raw request sending</title> |
| 7 | <meta http-equiv="content-type" content="text/html;charset=utf-8" /> |
| 8 | <script type="text/javascript" src="http://ajax.googleapis.com/ajax/libs/jquery/1.6.4/jquery.min.js"></script> |
| 9 | <script type="text/javascript" src="js/whajaj.js"></script> |
| 10 | <script type="text/javascript" src="js/fossil-ajaj.js"></script> |
| 11 | |
| 12 | <style type='text/css'> |
| 13 |
| --- ajax/index.html | |
| +++ ajax/index.html | |
| @@ -1,12 +1,11 @@ | |
| 1 | <!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd"> |
| 2 | <html xmlns="http://www.w3.org/1999/xhtml" xml:lang="en" lang="en"> |
| 3 | |
| 4 | <head> |
| 5 | <title>Fossil/JSON raw request sending</title> |
| 6 | <meta http-equiv="content-type" content="text/html;charset=utf-8" /> |
| 7 | <script type="text/javascript" src="http://ajax.googleapis.com/ajax/libs/jquery/1.6.4/jquery.min.js"></script> |
| 8 | <script type="text/javascript" src="js/whajaj.js"></script> |
| 9 | <script type="text/javascript" src="js/fossil-ajaj.js"></script> |
| 10 | |
| 11 | <style type='text/css'> |
| 12 |
+3
-4
| --- ajax/wiki-editor.html | ||
| +++ ajax/wiki-editor.html | ||
| @@ -1,12 +1,11 @@ | ||
| 1 | -<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN" | |
| 2 | - "http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd"> | |
| 1 | +<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd"> | |
| 3 | 2 | <html xmlns="http://www.w3.org/1999/xhtml" xml:lang="en" lang="en"> |
| 4 | 3 | |
| 5 | 4 | <head> |
| 6 | - <title>Fossil/JSON Wiki Editor Prototype</title> | |
| 7 | - <meta http-equiv="content-type" content="text/html;charset=utf-8" /> | |
| 5 | + <title>Fossil/JSON Wiki Editor Prototype</title> | |
| 6 | + <meta http-equiv="content-type" content="text/html;charset=utf-8" /> | |
| 8 | 7 | <script type="text/javascript" src="http://ajax.googleapis.com/ajax/libs/jquery/1.4.2/jquery.min.js"></script> |
| 9 | 8 | <script type="text/javascript" src="js/whajaj.js"></script> |
| 10 | 9 | <script type="text/javascript" src="js/fossil-ajaj.js"></script> |
| 11 | 10 | |
| 12 | 11 | <style type='text/css'> |
| 13 | 12 |
| --- ajax/wiki-editor.html | |
| +++ ajax/wiki-editor.html | |
| @@ -1,12 +1,11 @@ | |
| 1 | <!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN" |
| 2 | "http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd"> |
| 3 | <html xmlns="http://www.w3.org/1999/xhtml" xml:lang="en" lang="en"> |
| 4 | |
| 5 | <head> |
| 6 | <title>Fossil/JSON Wiki Editor Prototype</title> |
| 7 | <meta http-equiv="content-type" content="text/html;charset=utf-8" /> |
| 8 | <script type="text/javascript" src="http://ajax.googleapis.com/ajax/libs/jquery/1.4.2/jquery.min.js"></script> |
| 9 | <script type="text/javascript" src="js/whajaj.js"></script> |
| 10 | <script type="text/javascript" src="js/fossil-ajaj.js"></script> |
| 11 | |
| 12 | <style type='text/css'> |
| 13 |
| --- ajax/wiki-editor.html | |
| +++ ajax/wiki-editor.html | |
| @@ -1,12 +1,11 @@ | |
| 1 | <!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd"> |
| 2 | <html xmlns="http://www.w3.org/1999/xhtml" xml:lang="en" lang="en"> |
| 3 | |
| 4 | <head> |
| 5 | <title>Fossil/JSON Wiki Editor Prototype</title> |
| 6 | <meta http-equiv="content-type" content="text/html;charset=utf-8" /> |
| 7 | <script type="text/javascript" src="http://ajax.googleapis.com/ajax/libs/jquery/1.4.2/jquery.min.js"></script> |
| 8 | <script type="text/javascript" src="js/whajaj.js"></script> |
| 9 | <script type="text/javascript" src="js/fossil-ajaj.js"></script> |
| 10 | |
| 11 | <style type='text/css'> |
| 12 |
+1
-1
| --- src/codecheck1.c | ||
| +++ src/codecheck1.c | ||
| @@ -437,11 +437,11 @@ | ||
| 437 | 437 | const char **azArg = 0; |
| 438 | 438 | int i, k; |
| 439 | 439 | int nErr = 0; |
| 440 | 440 | char *acType; |
| 441 | 441 | |
| 442 | - szFName = token_length(zFCall, &eToken, &ln); | |
| 442 | + szFName = token_length(zFCall, &eToken, &ln); | |
| 443 | 443 | zStart = next_non_whitespace(zFCall+szFName, &len, &eToken); |
| 444 | 444 | assert( zStart[0]=='(' && len==1 ); |
| 445 | 445 | len = distance_to(zStart+1, ')'); |
| 446 | 446 | zCopy = safe_malloc( len + 1 ); |
| 447 | 447 | memcpy(zCopy, zStart+1, len); |
| 448 | 448 |
| --- src/codecheck1.c | |
| +++ src/codecheck1.c | |
| @@ -437,11 +437,11 @@ | |
| 437 | const char **azArg = 0; |
| 438 | int i, k; |
| 439 | int nErr = 0; |
| 440 | char *acType; |
| 441 | |
| 442 | szFName = token_length(zFCall, &eToken, &ln); |
| 443 | zStart = next_non_whitespace(zFCall+szFName, &len, &eToken); |
| 444 | assert( zStart[0]=='(' && len==1 ); |
| 445 | len = distance_to(zStart+1, ')'); |
| 446 | zCopy = safe_malloc( len + 1 ); |
| 447 | memcpy(zCopy, zStart+1, len); |
| 448 |
| --- src/codecheck1.c | |
| +++ src/codecheck1.c | |
| @@ -437,11 +437,11 @@ | |
| 437 | const char **azArg = 0; |
| 438 | int i, k; |
| 439 | int nErr = 0; |
| 440 | char *acType; |
| 441 | |
| 442 | szFName = token_length(zFCall, &eToken, &ln); |
| 443 | zStart = next_non_whitespace(zFCall+szFName, &len, &eToken); |
| 444 | assert( zStart[0]=='(' && len==1 ); |
| 445 | len = distance_to(zStart+1, ')'); |
| 446 | zCopy = safe_malloc( len + 1 ); |
| 447 | memcpy(zCopy, zStart+1, len); |
| 448 |
+1
-1
| --- src/export.c | ||
| +++ src/export.c | ||
| @@ -282,11 +282,11 @@ | ||
| 282 | 282 | } |
| 283 | 283 | } |
| 284 | 284 | if( unused_mark!=NULL ){ |
| 285 | 285 | unsigned int mid = atoi(mark.name + 1); |
| 286 | 286 | if( mid>=*unused_mark ){ |
| 287 | - *unused_mark = mid + 1; | |
| 287 | + *unused_mark = mid + 1; | |
| 288 | 288 | } |
| 289 | 289 | } |
| 290 | 290 | free(mark.name); |
| 291 | 291 | } |
| 292 | 292 | return 0; |
| 293 | 293 |
| --- src/export.c | |
| +++ src/export.c | |
| @@ -282,11 +282,11 @@ | |
| 282 | } |
| 283 | } |
| 284 | if( unused_mark!=NULL ){ |
| 285 | unsigned int mid = atoi(mark.name + 1); |
| 286 | if( mid>=*unused_mark ){ |
| 287 | *unused_mark = mid + 1; |
| 288 | } |
| 289 | } |
| 290 | free(mark.name); |
| 291 | } |
| 292 | return 0; |
| 293 |
| --- src/export.c | |
| +++ src/export.c | |
| @@ -282,11 +282,11 @@ | |
| 282 | } |
| 283 | } |
| 284 | if( unused_mark!=NULL ){ |
| 285 | unsigned int mid = atoi(mark.name + 1); |
| 286 | if( mid>=*unused_mark ){ |
| 287 | *unused_mark = mid + 1; |
| 288 | } |
| 289 | } |
| 290 | free(mark.name); |
| 291 | } |
| 292 | return 0; |
| 293 |
+1
-1
| --- src/finfo.c | ||
| +++ src/finfo.c | ||
| @@ -398,11 +398,11 @@ | ||
| 398 | 398 | } |
| 399 | 399 | blob_reset(&sql); |
| 400 | 400 | blob_zero(&title); |
| 401 | 401 | if( baseCheckin ){ |
| 402 | 402 | char *zUuid = db_text(0, "SELECT uuid FROM blob WHERE rid=%d", baseCheckin); |
| 403 | - char *zLink = href("%R/info/%!S", zUuid); | |
| 403 | + char *zLink = href("%R/info/%!S", zUuid); | |
| 404 | 404 | if( n>0 ){ |
| 405 | 405 | blob_appendf(&title, "First %d ancestors of file ", n); |
| 406 | 406 | }else{ |
| 407 | 407 | blob_appendf(&title, "Ancestors of file "); |
| 408 | 408 | } |
| 409 | 409 |
| --- src/finfo.c | |
| +++ src/finfo.c | |
| @@ -398,11 +398,11 @@ | |
| 398 | } |
| 399 | blob_reset(&sql); |
| 400 | blob_zero(&title); |
| 401 | if( baseCheckin ){ |
| 402 | char *zUuid = db_text(0, "SELECT uuid FROM blob WHERE rid=%d", baseCheckin); |
| 403 | char *zLink = href("%R/info/%!S", zUuid); |
| 404 | if( n>0 ){ |
| 405 | blob_appendf(&title, "First %d ancestors of file ", n); |
| 406 | }else{ |
| 407 | blob_appendf(&title, "Ancestors of file "); |
| 408 | } |
| 409 |
| --- src/finfo.c | |
| +++ src/finfo.c | |
| @@ -398,11 +398,11 @@ | |
| 398 | } |
| 399 | blob_reset(&sql); |
| 400 | blob_zero(&title); |
| 401 | if( baseCheckin ){ |
| 402 | char *zUuid = db_text(0, "SELECT uuid FROM blob WHERE rid=%d", baseCheckin); |
| 403 | char *zLink = href("%R/info/%!S", zUuid); |
| 404 | if( n>0 ){ |
| 405 | blob_appendf(&title, "First %d ancestors of file ", n); |
| 406 | }else{ |
| 407 | blob_appendf(&title, "Ancestors of file "); |
| 408 | } |
| 409 |
+7
-7
| --- src/json_artifact.c | ||
| +++ src/json_artifact.c | ||
| @@ -91,11 +91,11 @@ | ||
| 91 | 91 | static cson_value * eventTypeLabel = NULL; |
| 92 | 92 | if(!eventTypeLabel){ |
| 93 | 93 | eventTypeLabel = json_new_string("checkin"); |
| 94 | 94 | json_gc_add("$EVENT_TYPE_LABEL(commit)", eventTypeLabel); |
| 95 | 95 | } |
| 96 | - | |
| 96 | + | |
| 97 | 97 | db_prepare(&q, |
| 98 | 98 | "SELECT b.uuid, " |
| 99 | 99 | " cast(strftime('%%s',e.mtime) as int), " |
| 100 | 100 | " strftime('%%s',e.omtime)," |
| 101 | 101 | " e.user, " |
| @@ -140,11 +140,11 @@ | ||
| 140 | 140 | }else{ |
| 141 | 141 | SET("user",json_new_string(zUser)); |
| 142 | 142 | } |
| 143 | 143 | |
| 144 | 144 | zComment = db_column_text(&q,4); |
| 145 | - zEComment = db_text(0, | |
| 145 | + zEComment = db_text(0, | |
| 146 | 146 | "SELECT value FROM tagxref WHERE tagid=%d AND rid=%d", |
| 147 | 147 | TAG_COMMENT, rid); |
| 148 | 148 | if(zEComment){ |
| 149 | 149 | SET("comment",json_new_string(zEComment)); |
| 150 | 150 | if(0 != fossil_strcmp(zEComment,zComment)){ |
| @@ -244,11 +244,11 @@ | ||
| 244 | 244 | ** |
| 245 | 245 | ** If the "format" (CLI: -f) flag is set function returns the same as |
| 246 | 246 | ** json_wiki_get_content_format_flag(), else it returns true (non-0) |
| 247 | 247 | ** if either the includeContent (HTTP) or -content|-c boolean flags |
| 248 | 248 | ** (CLI) are set. |
| 249 | -*/ | |
| 249 | +*/ | |
| 250 | 250 | static int json_artifact_get_content_format_flag(){ |
| 251 | 251 | enum { MagicValue = -9 }; |
| 252 | 252 | int contentFormat = json_wiki_get_content_format_flag(MagicValue); |
| 253 | 253 | if(MagicValue == contentFormat){ |
| 254 | 254 | contentFormat = json_find_option_bool("includeContent","content","c",0) /* deprecated */ ? -1 : 0; |
| @@ -270,11 +270,11 @@ | ||
| 270 | 270 | } |
| 271 | 271 | } |
| 272 | 272 | |
| 273 | 273 | /* |
| 274 | 274 | ** Internal helper for routines which add a "status" flag to file |
| 275 | -** artifact data. isNew and isDel should be the "is this object new?" | |
| 275 | +** artifact data. isNew and isDel should be the "is this object new?" | |
| 276 | 276 | ** and "is this object removed?" flags of the underlying query. This |
| 277 | 277 | ** function returns a static string from the set (added, removed, |
| 278 | 278 | ** modified), depending on the combination of the two args. |
| 279 | 279 | ** |
| 280 | 280 | ** Reminder to self: (mlink.pid==0) AS isNew, (mlink.fid==0) AS isDel |
| @@ -297,11 +297,11 @@ | ||
| 297 | 297 | if( ! g.perm.Read ){ |
| 298 | 298 | json_set_err(FSL_JSON_E_DENIED, |
| 299 | 299 | "Requires 'o' privileges."); |
| 300 | 300 | return NULL; |
| 301 | 301 | } |
| 302 | - | |
| 302 | + | |
| 303 | 303 | pay = zParent; |
| 304 | 304 | |
| 305 | 305 | contentFormat = json_artifact_get_content_format_flag(); |
| 306 | 306 | if( 0 != contentFormat ){ |
| 307 | 307 | Blob content = empty_blob; |
| @@ -345,11 +345,11 @@ | ||
| 345 | 345 | ); |
| 346 | 346 | if(parentUuid){ |
| 347 | 347 | cson_object_set( zParent, "parent", json_new_string(parentUuid) ); |
| 348 | 348 | fossil_free(parentUuid); |
| 349 | 349 | } |
| 350 | - | |
| 350 | + | |
| 351 | 351 | /* Find check-ins associated with this file... */ |
| 352 | 352 | db_prepare(&q, |
| 353 | 353 | "SELECT filename.name AS name, " |
| 354 | 354 | " (mlink.pid==0) AS isNew," |
| 355 | 355 | " (mlink.fid==0) AS isDel," |
| @@ -376,11 +376,11 @@ | ||
| 376 | 376 | TAG_BRANCH, rid |
| 377 | 377 | ); |
| 378 | 378 | /* TODO: add a "state" flag for the file in each check-in, |
| 379 | 379 | e.g. "modified", "new", "deleted". |
| 380 | 380 | */ |
| 381 | - checkin_arr = cson_new_array(); | |
| 381 | + checkin_arr = cson_new_array(); | |
| 382 | 382 | cson_object_set(pay, "checkins", cson_array_value(checkin_arr)); |
| 383 | 383 | while( (SQLITE_ROW==db_step(&q) ) ){ |
| 384 | 384 | cson_object * row = cson_value_get_object(cson_sqlite3_row_to_object(q.pStmt)); |
| 385 | 385 | /* FIXME: move this isNew/isDel stuff into an SQL CASE statement. */ |
| 386 | 386 | char const isNew = cson_value_get_bool(cson_object_get(row,"isNew")); |
| 387 | 387 |
| --- src/json_artifact.c | |
| +++ src/json_artifact.c | |
| @@ -91,11 +91,11 @@ | |
| 91 | static cson_value * eventTypeLabel = NULL; |
| 92 | if(!eventTypeLabel){ |
| 93 | eventTypeLabel = json_new_string("checkin"); |
| 94 | json_gc_add("$EVENT_TYPE_LABEL(commit)", eventTypeLabel); |
| 95 | } |
| 96 | |
| 97 | db_prepare(&q, |
| 98 | "SELECT b.uuid, " |
| 99 | " cast(strftime('%%s',e.mtime) as int), " |
| 100 | " strftime('%%s',e.omtime)," |
| 101 | " e.user, " |
| @@ -140,11 +140,11 @@ | |
| 140 | }else{ |
| 141 | SET("user",json_new_string(zUser)); |
| 142 | } |
| 143 | |
| 144 | zComment = db_column_text(&q,4); |
| 145 | zEComment = db_text(0, |
| 146 | "SELECT value FROM tagxref WHERE tagid=%d AND rid=%d", |
| 147 | TAG_COMMENT, rid); |
| 148 | if(zEComment){ |
| 149 | SET("comment",json_new_string(zEComment)); |
| 150 | if(0 != fossil_strcmp(zEComment,zComment)){ |
| @@ -244,11 +244,11 @@ | |
| 244 | ** |
| 245 | ** If the "format" (CLI: -f) flag is set function returns the same as |
| 246 | ** json_wiki_get_content_format_flag(), else it returns true (non-0) |
| 247 | ** if either the includeContent (HTTP) or -content|-c boolean flags |
| 248 | ** (CLI) are set. |
| 249 | */ |
| 250 | static int json_artifact_get_content_format_flag(){ |
| 251 | enum { MagicValue = -9 }; |
| 252 | int contentFormat = json_wiki_get_content_format_flag(MagicValue); |
| 253 | if(MagicValue == contentFormat){ |
| 254 | contentFormat = json_find_option_bool("includeContent","content","c",0) /* deprecated */ ? -1 : 0; |
| @@ -270,11 +270,11 @@ | |
| 270 | } |
| 271 | } |
| 272 | |
| 273 | /* |
| 274 | ** Internal helper for routines which add a "status" flag to file |
| 275 | ** artifact data. isNew and isDel should be the "is this object new?" |
| 276 | ** and "is this object removed?" flags of the underlying query. This |
| 277 | ** function returns a static string from the set (added, removed, |
| 278 | ** modified), depending on the combination of the two args. |
| 279 | ** |
| 280 | ** Reminder to self: (mlink.pid==0) AS isNew, (mlink.fid==0) AS isDel |
| @@ -297,11 +297,11 @@ | |
| 297 | if( ! g.perm.Read ){ |
| 298 | json_set_err(FSL_JSON_E_DENIED, |
| 299 | "Requires 'o' privileges."); |
| 300 | return NULL; |
| 301 | } |
| 302 | |
| 303 | pay = zParent; |
| 304 | |
| 305 | contentFormat = json_artifact_get_content_format_flag(); |
| 306 | if( 0 != contentFormat ){ |
| 307 | Blob content = empty_blob; |
| @@ -345,11 +345,11 @@ | |
| 345 | ); |
| 346 | if(parentUuid){ |
| 347 | cson_object_set( zParent, "parent", json_new_string(parentUuid) ); |
| 348 | fossil_free(parentUuid); |
| 349 | } |
| 350 | |
| 351 | /* Find check-ins associated with this file... */ |
| 352 | db_prepare(&q, |
| 353 | "SELECT filename.name AS name, " |
| 354 | " (mlink.pid==0) AS isNew," |
| 355 | " (mlink.fid==0) AS isDel," |
| @@ -376,11 +376,11 @@ | |
| 376 | TAG_BRANCH, rid |
| 377 | ); |
| 378 | /* TODO: add a "state" flag for the file in each check-in, |
| 379 | e.g. "modified", "new", "deleted". |
| 380 | */ |
| 381 | checkin_arr = cson_new_array(); |
| 382 | cson_object_set(pay, "checkins", cson_array_value(checkin_arr)); |
| 383 | while( (SQLITE_ROW==db_step(&q) ) ){ |
| 384 | cson_object * row = cson_value_get_object(cson_sqlite3_row_to_object(q.pStmt)); |
| 385 | /* FIXME: move this isNew/isDel stuff into an SQL CASE statement. */ |
| 386 | char const isNew = cson_value_get_bool(cson_object_get(row,"isNew")); |
| 387 |
| --- src/json_artifact.c | |
| +++ src/json_artifact.c | |
| @@ -91,11 +91,11 @@ | |
| 91 | static cson_value * eventTypeLabel = NULL; |
| 92 | if(!eventTypeLabel){ |
| 93 | eventTypeLabel = json_new_string("checkin"); |
| 94 | json_gc_add("$EVENT_TYPE_LABEL(commit)", eventTypeLabel); |
| 95 | } |
| 96 | |
| 97 | db_prepare(&q, |
| 98 | "SELECT b.uuid, " |
| 99 | " cast(strftime('%%s',e.mtime) as int), " |
| 100 | " strftime('%%s',e.omtime)," |
| 101 | " e.user, " |
| @@ -140,11 +140,11 @@ | |
| 140 | }else{ |
| 141 | SET("user",json_new_string(zUser)); |
| 142 | } |
| 143 | |
| 144 | zComment = db_column_text(&q,4); |
| 145 | zEComment = db_text(0, |
| 146 | "SELECT value FROM tagxref WHERE tagid=%d AND rid=%d", |
| 147 | TAG_COMMENT, rid); |
| 148 | if(zEComment){ |
| 149 | SET("comment",json_new_string(zEComment)); |
| 150 | if(0 != fossil_strcmp(zEComment,zComment)){ |
| @@ -244,11 +244,11 @@ | |
| 244 | ** |
| 245 | ** If the "format" (CLI: -f) flag is set function returns the same as |
| 246 | ** json_wiki_get_content_format_flag(), else it returns true (non-0) |
| 247 | ** if either the includeContent (HTTP) or -content|-c boolean flags |
| 248 | ** (CLI) are set. |
| 249 | */ |
| 250 | static int json_artifact_get_content_format_flag(){ |
| 251 | enum { MagicValue = -9 }; |
| 252 | int contentFormat = json_wiki_get_content_format_flag(MagicValue); |
| 253 | if(MagicValue == contentFormat){ |
| 254 | contentFormat = json_find_option_bool("includeContent","content","c",0) /* deprecated */ ? -1 : 0; |
| @@ -270,11 +270,11 @@ | |
| 270 | } |
| 271 | } |
| 272 | |
| 273 | /* |
| 274 | ** Internal helper for routines which add a "status" flag to file |
| 275 | ** artifact data. isNew and isDel should be the "is this object new?" |
| 276 | ** and "is this object removed?" flags of the underlying query. This |
| 277 | ** function returns a static string from the set (added, removed, |
| 278 | ** modified), depending on the combination of the two args. |
| 279 | ** |
| 280 | ** Reminder to self: (mlink.pid==0) AS isNew, (mlink.fid==0) AS isDel |
| @@ -297,11 +297,11 @@ | |
| 297 | if( ! g.perm.Read ){ |
| 298 | json_set_err(FSL_JSON_E_DENIED, |
| 299 | "Requires 'o' privileges."); |
| 300 | return NULL; |
| 301 | } |
| 302 | |
| 303 | pay = zParent; |
| 304 | |
| 305 | contentFormat = json_artifact_get_content_format_flag(); |
| 306 | if( 0 != contentFormat ){ |
| 307 | Blob content = empty_blob; |
| @@ -345,11 +345,11 @@ | |
| 345 | ); |
| 346 | if(parentUuid){ |
| 347 | cson_object_set( zParent, "parent", json_new_string(parentUuid) ); |
| 348 | fossil_free(parentUuid); |
| 349 | } |
| 350 | |
| 351 | /* Find check-ins associated with this file... */ |
| 352 | db_prepare(&q, |
| 353 | "SELECT filename.name AS name, " |
| 354 | " (mlink.pid==0) AS isNew," |
| 355 | " (mlink.fid==0) AS isDel," |
| @@ -376,11 +376,11 @@ | |
| 376 | TAG_BRANCH, rid |
| 377 | ); |
| 378 | /* TODO: add a "state" flag for the file in each check-in, |
| 379 | e.g. "modified", "new", "deleted". |
| 380 | */ |
| 381 | checkin_arr = cson_new_array(); |
| 382 | cson_object_set(pay, "checkins", cson_array_value(checkin_arr)); |
| 383 | while( (SQLITE_ROW==db_step(&q) ) ){ |
| 384 | cson_object * row = cson_value_get_object(cson_sqlite3_row_to_object(q.pStmt)); |
| 385 | /* FIXME: move this isNew/isDel stuff into an SQL CASE statement. */ |
| 386 | char const isNew = cson_value_get_bool(cson_object_get(row,"isNew")); |
| 387 |
+4
-4
| --- src/json_branch.c | ||
| +++ src/json_branch.c | ||
| @@ -127,11 +127,11 @@ | ||
| 127 | 127 | if(zCurrent){ |
| 128 | 128 | cson_object_set(pay,"current",json_new_string(zCurrent)); |
| 129 | 129 | } |
| 130 | 130 | } |
| 131 | 131 | |
| 132 | - | |
| 132 | + | |
| 133 | 133 | branch_prepare_list_query(&q, branchListFlags); |
| 134 | 134 | cson_object_set(pay,"branches",listV); |
| 135 | 135 | while((SQLITE_ROW==db_step(&q))){ |
| 136 | 136 | cson_value * v = cson_sqlite3_column_to_value(q.pStmt,0); |
| 137 | 137 | if(v){ |
| @@ -281,11 +281,11 @@ | ||
| 281 | 281 | while( db_step(&q)==SQLITE_ROW ){ |
| 282 | 282 | const char *zTag = db_column_text(&q, 0); |
| 283 | 283 | blob_appendf(&branch, "T -%F *\n", zTag); |
| 284 | 284 | } |
| 285 | 285 | db_finalize(&q); |
| 286 | - | |
| 286 | + | |
| 287 | 287 | blob_appendf(&branch, "U %F\n", g.zLogin); |
| 288 | 288 | md5sum_blob(&branch, &mcksum); |
| 289 | 289 | blob_appendf(&branch, "Z %b\n", &mcksum); |
| 290 | 290 | |
| 291 | 291 | brid = content_put(&branch); |
| @@ -302,11 +302,11 @@ | ||
| 302 | 302 | *zNewRid = brid; |
| 303 | 303 | } |
| 304 | 304 | |
| 305 | 305 | /* Commit */ |
| 306 | 306 | db_end_transaction(0); |
| 307 | - | |
| 307 | + | |
| 308 | 308 | #if 0 /* Do an autosync push, if requested */ |
| 309 | 309 | /* arugable for JSON mode? */ |
| 310 | 310 | if( !g.isHTTP && !isPrivate ) autosync(SYNC_PUSH); |
| 311 | 311 | #endif |
| 312 | 312 | return 0; |
| @@ -356,11 +356,11 @@ | ||
| 356 | 356 | opt.isPrivate = (NULL != find_option("private","",0)); |
| 357 | 357 | }else{ |
| 358 | 358 | opt.isPrivate = 0; |
| 359 | 359 | } |
| 360 | 360 | } |
| 361 | - | |
| 361 | + | |
| 362 | 362 | rc = json_branch_new( &opt, &rid ); |
| 363 | 363 | if(rc){ |
| 364 | 364 | json_set_err(rc, opt.rcErrMsg); |
| 365 | 365 | goto error; |
| 366 | 366 | } |
| 367 | 367 |
| --- src/json_branch.c | |
| +++ src/json_branch.c | |
| @@ -127,11 +127,11 @@ | |
| 127 | if(zCurrent){ |
| 128 | cson_object_set(pay,"current",json_new_string(zCurrent)); |
| 129 | } |
| 130 | } |
| 131 | |
| 132 | |
| 133 | branch_prepare_list_query(&q, branchListFlags); |
| 134 | cson_object_set(pay,"branches",listV); |
| 135 | while((SQLITE_ROW==db_step(&q))){ |
| 136 | cson_value * v = cson_sqlite3_column_to_value(q.pStmt,0); |
| 137 | if(v){ |
| @@ -281,11 +281,11 @@ | |
| 281 | while( db_step(&q)==SQLITE_ROW ){ |
| 282 | const char *zTag = db_column_text(&q, 0); |
| 283 | blob_appendf(&branch, "T -%F *\n", zTag); |
| 284 | } |
| 285 | db_finalize(&q); |
| 286 | |
| 287 | blob_appendf(&branch, "U %F\n", g.zLogin); |
| 288 | md5sum_blob(&branch, &mcksum); |
| 289 | blob_appendf(&branch, "Z %b\n", &mcksum); |
| 290 | |
| 291 | brid = content_put(&branch); |
| @@ -302,11 +302,11 @@ | |
| 302 | *zNewRid = brid; |
| 303 | } |
| 304 | |
| 305 | /* Commit */ |
| 306 | db_end_transaction(0); |
| 307 | |
| 308 | #if 0 /* Do an autosync push, if requested */ |
| 309 | /* arugable for JSON mode? */ |
| 310 | if( !g.isHTTP && !isPrivate ) autosync(SYNC_PUSH); |
| 311 | #endif |
| 312 | return 0; |
| @@ -356,11 +356,11 @@ | |
| 356 | opt.isPrivate = (NULL != find_option("private","",0)); |
| 357 | }else{ |
| 358 | opt.isPrivate = 0; |
| 359 | } |
| 360 | } |
| 361 | |
| 362 | rc = json_branch_new( &opt, &rid ); |
| 363 | if(rc){ |
| 364 | json_set_err(rc, opt.rcErrMsg); |
| 365 | goto error; |
| 366 | } |
| 367 |
| --- src/json_branch.c | |
| +++ src/json_branch.c | |
| @@ -127,11 +127,11 @@ | |
| 127 | if(zCurrent){ |
| 128 | cson_object_set(pay,"current",json_new_string(zCurrent)); |
| 129 | } |
| 130 | } |
| 131 | |
| 132 | |
| 133 | branch_prepare_list_query(&q, branchListFlags); |
| 134 | cson_object_set(pay,"branches",listV); |
| 135 | while((SQLITE_ROW==db_step(&q))){ |
| 136 | cson_value * v = cson_sqlite3_column_to_value(q.pStmt,0); |
| 137 | if(v){ |
| @@ -281,11 +281,11 @@ | |
| 281 | while( db_step(&q)==SQLITE_ROW ){ |
| 282 | const char *zTag = db_column_text(&q, 0); |
| 283 | blob_appendf(&branch, "T -%F *\n", zTag); |
| 284 | } |
| 285 | db_finalize(&q); |
| 286 | |
| 287 | blob_appendf(&branch, "U %F\n", g.zLogin); |
| 288 | md5sum_blob(&branch, &mcksum); |
| 289 | blob_appendf(&branch, "Z %b\n", &mcksum); |
| 290 | |
| 291 | brid = content_put(&branch); |
| @@ -302,11 +302,11 @@ | |
| 302 | *zNewRid = brid; |
| 303 | } |
| 304 | |
| 305 | /* Commit */ |
| 306 | db_end_transaction(0); |
| 307 | |
| 308 | #if 0 /* Do an autosync push, if requested */ |
| 309 | /* arugable for JSON mode? */ |
| 310 | if( !g.isHTTP && !isPrivate ) autosync(SYNC_PUSH); |
| 311 | #endif |
| 312 | return 0; |
| @@ -356,11 +356,11 @@ | |
| 356 | opt.isPrivate = (NULL != find_option("private","",0)); |
| 357 | }else{ |
| 358 | opt.isPrivate = 0; |
| 359 | } |
| 360 | } |
| 361 | |
| 362 | rc = json_branch_new( &opt, &rid ); |
| 363 | if(rc){ |
| 364 | json_set_err(rc, opt.rcErrMsg); |
| 365 | goto error; |
| 366 | } |
| 367 |
+1
-1
| --- src/json_diff.c | ||
| +++ src/json_diff.c | ||
| @@ -129,10 +129,10 @@ | ||
| 129 | 129 | pay = cson_new_object(); |
| 130 | 130 | cson_object_set(pay, "from", json_new_string(zFrom)); |
| 131 | 131 | cson_object_set(pay, "to", json_new_string(zTo)); |
| 132 | 132 | cson_object_set(pay, "diff", v); |
| 133 | 133 | v = 0; |
| 134 | - | |
| 134 | + | |
| 135 | 135 | return pay ? cson_object_value(pay) : NULL; |
| 136 | 136 | } |
| 137 | 137 | |
| 138 | 138 | #endif /* FOSSIL_ENABLE_JSON */ |
| 139 | 139 |
| --- src/json_diff.c | |
| +++ src/json_diff.c | |
| @@ -129,10 +129,10 @@ | |
| 129 | pay = cson_new_object(); |
| 130 | cson_object_set(pay, "from", json_new_string(zFrom)); |
| 131 | cson_object_set(pay, "to", json_new_string(zTo)); |
| 132 | cson_object_set(pay, "diff", v); |
| 133 | v = 0; |
| 134 | |
| 135 | return pay ? cson_object_value(pay) : NULL; |
| 136 | } |
| 137 | |
| 138 | #endif /* FOSSIL_ENABLE_JSON */ |
| 139 |
| --- src/json_diff.c | |
| +++ src/json_diff.c | |
| @@ -129,10 +129,10 @@ | |
| 129 | pay = cson_new_object(); |
| 130 | cson_object_set(pay, "from", json_new_string(zFrom)); |
| 131 | cson_object_set(pay, "to", json_new_string(zTo)); |
| 132 | cson_object_set(pay, "diff", v); |
| 133 | v = 0; |
| 134 | |
| 135 | return pay ? cson_object_value(pay) : NULL; |
| 136 | } |
| 137 | |
| 138 | #endif /* FOSSIL_ENABLE_JSON */ |
| 139 |
+2
-2
| --- src/json_finfo.c | ||
| +++ src/json_finfo.c | ||
| @@ -56,17 +56,17 @@ | ||
| 56 | 56 | |
| 57 | 57 | if(0==db_int(0,"SELECT 1 FROM filename WHERE name=%Q",zFilename)){ |
| 58 | 58 | json_set_err(FSL_JSON_E_RESOURCE_NOT_FOUND, "File entry not found."); |
| 59 | 59 | return NULL; |
| 60 | 60 | } |
| 61 | - | |
| 61 | + | |
| 62 | 62 | zBefore = json_find_option_cstr("before",NULL,"b"); |
| 63 | 63 | zAfter = json_find_option_cstr("after",NULL,"a"); |
| 64 | 64 | limit = json_find_option_int("limit",NULL,"n", -1); |
| 65 | 65 | zCheckin = json_find_option_cstr("checkin",NULL,"ci"); |
| 66 | 66 | |
| 67 | - blob_append_sql(&sql, | |
| 67 | + blob_append_sql(&sql, | |
| 68 | 68 | /*0*/ "SELECT b.uuid," |
| 69 | 69 | /*1*/ " ci.uuid," |
| 70 | 70 | /*2*/ " (SELECT uuid FROM blob WHERE rid=mlink.fid)," /* Current file uuid */ |
| 71 | 71 | /*3*/ " cast(strftime('%%s',event.mtime) AS INTEGER)," |
| 72 | 72 | /*4*/ " coalesce(event.euser, event.user)," |
| 73 | 73 |
| --- src/json_finfo.c | |
| +++ src/json_finfo.c | |
| @@ -56,17 +56,17 @@ | |
| 56 | |
| 57 | if(0==db_int(0,"SELECT 1 FROM filename WHERE name=%Q",zFilename)){ |
| 58 | json_set_err(FSL_JSON_E_RESOURCE_NOT_FOUND, "File entry not found."); |
| 59 | return NULL; |
| 60 | } |
| 61 | |
| 62 | zBefore = json_find_option_cstr("before",NULL,"b"); |
| 63 | zAfter = json_find_option_cstr("after",NULL,"a"); |
| 64 | limit = json_find_option_int("limit",NULL,"n", -1); |
| 65 | zCheckin = json_find_option_cstr("checkin",NULL,"ci"); |
| 66 | |
| 67 | blob_append_sql(&sql, |
| 68 | /*0*/ "SELECT b.uuid," |
| 69 | /*1*/ " ci.uuid," |
| 70 | /*2*/ " (SELECT uuid FROM blob WHERE rid=mlink.fid)," /* Current file uuid */ |
| 71 | /*3*/ " cast(strftime('%%s',event.mtime) AS INTEGER)," |
| 72 | /*4*/ " coalesce(event.euser, event.user)," |
| 73 |
| --- src/json_finfo.c | |
| +++ src/json_finfo.c | |
| @@ -56,17 +56,17 @@ | |
| 56 | |
| 57 | if(0==db_int(0,"SELECT 1 FROM filename WHERE name=%Q",zFilename)){ |
| 58 | json_set_err(FSL_JSON_E_RESOURCE_NOT_FOUND, "File entry not found."); |
| 59 | return NULL; |
| 60 | } |
| 61 | |
| 62 | zBefore = json_find_option_cstr("before",NULL,"b"); |
| 63 | zAfter = json_find_option_cstr("after",NULL,"a"); |
| 64 | limit = json_find_option_int("limit",NULL,"n", -1); |
| 65 | zCheckin = json_find_option_cstr("checkin",NULL,"ci"); |
| 66 | |
| 67 | blob_append_sql(&sql, |
| 68 | /*0*/ "SELECT b.uuid," |
| 69 | /*1*/ " ci.uuid," |
| 70 | /*2*/ " (SELECT uuid FROM blob WHERE rid=mlink.fid)," /* Current file uuid */ |
| 71 | /*3*/ " cast(strftime('%%s',event.mtime) AS INTEGER)," |
| 72 | /*4*/ " coalesce(event.euser, event.user)," |
| 73 |
+1
-1
| --- src/json_login.c | ||
| +++ src/json_login.c | ||
| @@ -157,11 +157,11 @@ | ||
| 157 | 157 | cson_object_set(po, "authToken", json_new_string(cookie)); |
| 158 | 158 | free(cookie); |
| 159 | 159 | cson_object_set(po, "name", json_new_string(name)); |
| 160 | 160 | cap = db_text(NULL, "SELECT cap FROM user WHERE login=%Q", name); |
| 161 | 161 | cson_object_set(po, "capabilities", cap ? json_new_string(cap) : cson_value_null() ); |
| 162 | - free(cap); | |
| 162 | + free(cap); | |
| 163 | 163 | cson_object_set(po, "loginCookieName", json_new_string( login_cookie_name() ) ); |
| 164 | 164 | /* TODO: add loginExpiryTime to the payload. To do this properly |
| 165 | 165 | we "should" add an ([unsigned] int *) to |
| 166 | 166 | login_set_user_cookie() and login_set_anon_cookie(), to which |
| 167 | 167 | the expiry time is assigned. (Remember that JSON doesn't do |
| 168 | 168 |
| --- src/json_login.c | |
| +++ src/json_login.c | |
| @@ -157,11 +157,11 @@ | |
| 157 | cson_object_set(po, "authToken", json_new_string(cookie)); |
| 158 | free(cookie); |
| 159 | cson_object_set(po, "name", json_new_string(name)); |
| 160 | cap = db_text(NULL, "SELECT cap FROM user WHERE login=%Q", name); |
| 161 | cson_object_set(po, "capabilities", cap ? json_new_string(cap) : cson_value_null() ); |
| 162 | free(cap); |
| 163 | cson_object_set(po, "loginCookieName", json_new_string( login_cookie_name() ) ); |
| 164 | /* TODO: add loginExpiryTime to the payload. To do this properly |
| 165 | we "should" add an ([unsigned] int *) to |
| 166 | login_set_user_cookie() and login_set_anon_cookie(), to which |
| 167 | the expiry time is assigned. (Remember that JSON doesn't do |
| 168 |
| --- src/json_login.c | |
| +++ src/json_login.c | |
| @@ -157,11 +157,11 @@ | |
| 157 | cson_object_set(po, "authToken", json_new_string(cookie)); |
| 158 | free(cookie); |
| 159 | cson_object_set(po, "name", json_new_string(name)); |
| 160 | cap = db_text(NULL, "SELECT cap FROM user WHERE login=%Q", name); |
| 161 | cson_object_set(po, "capabilities", cap ? json_new_string(cap) : cson_value_null() ); |
| 162 | free(cap); |
| 163 | cson_object_set(po, "loginCookieName", json_new_string( login_cookie_name() ) ); |
| 164 | /* TODO: add loginExpiryTime to the payload. To do this properly |
| 165 | we "should" add an ([unsigned] int *) to |
| 166 | login_set_user_cookie() and login_set_anon_cookie(), to which |
| 167 | the expiry time is assigned. (Remember that JSON doesn't do |
| 168 |
+2
-2
| --- src/json_report.c | ||
| +++ src/json_report.c | ||
| @@ -60,11 +60,11 @@ | ||
| 60 | 60 | ** Searches the environment for a "report" parameter |
| 61 | 61 | ** (CLI: -report/-r #). |
| 62 | 62 | ** |
| 63 | 63 | ** If one is not found and argPos is >0 then json_command_arg() |
| 64 | 64 | ** is checked. |
| 65 | -** | |
| 65 | +** | |
| 66 | 66 | ** Returns >0 (the report number) on success . |
| 67 | 67 | */ |
| 68 | 68 | static int json_report_get_number(int argPos){ |
| 69 | 69 | int nReport = json_find_option_int("report",NULL,"r",-1); |
| 70 | 70 | if( (nReport<=0) && cson_value_is_integer(g.json.reqPayload.v)){ |
| @@ -199,11 +199,11 @@ | ||
| 199 | 199 | goto error; |
| 200 | 200 | } |
| 201 | 201 | |
| 202 | 202 | limit = json_find_option_int("limit",NULL,"n",-1); |
| 203 | 203 | |
| 204 | - | |
| 204 | + | |
| 205 | 205 | /* Copy over report's SQL...*/ |
| 206 | 206 | blob_append(&sql, db_column_text(&q,0), -1); |
| 207 | 207 | zTitle = mprintf("%s", db_column_text(&q,1)); |
| 208 | 208 | db_finalize(&q); |
| 209 | 209 | db_prepare(&q, "%s", blob_sql_text(&sql)); |
| 210 | 210 |
| --- src/json_report.c | |
| +++ src/json_report.c | |
| @@ -60,11 +60,11 @@ | |
| 60 | ** Searches the environment for a "report" parameter |
| 61 | ** (CLI: -report/-r #). |
| 62 | ** |
| 63 | ** If one is not found and argPos is >0 then json_command_arg() |
| 64 | ** is checked. |
| 65 | ** |
| 66 | ** Returns >0 (the report number) on success . |
| 67 | */ |
| 68 | static int json_report_get_number(int argPos){ |
| 69 | int nReport = json_find_option_int("report",NULL,"r",-1); |
| 70 | if( (nReport<=0) && cson_value_is_integer(g.json.reqPayload.v)){ |
| @@ -199,11 +199,11 @@ | |
| 199 | goto error; |
| 200 | } |
| 201 | |
| 202 | limit = json_find_option_int("limit",NULL,"n",-1); |
| 203 | |
| 204 | |
| 205 | /* Copy over report's SQL...*/ |
| 206 | blob_append(&sql, db_column_text(&q,0), -1); |
| 207 | zTitle = mprintf("%s", db_column_text(&q,1)); |
| 208 | db_finalize(&q); |
| 209 | db_prepare(&q, "%s", blob_sql_text(&sql)); |
| 210 |
| --- src/json_report.c | |
| +++ src/json_report.c | |
| @@ -60,11 +60,11 @@ | |
| 60 | ** Searches the environment for a "report" parameter |
| 61 | ** (CLI: -report/-r #). |
| 62 | ** |
| 63 | ** If one is not found and argPos is >0 then json_command_arg() |
| 64 | ** is checked. |
| 65 | ** |
| 66 | ** Returns >0 (the report number) on success . |
| 67 | */ |
| 68 | static int json_report_get_number(int argPos){ |
| 69 | int nReport = json_find_option_int("report",NULL,"r",-1); |
| 70 | if( (nReport<=0) && cson_value_is_integer(g.json.reqPayload.v)){ |
| @@ -199,11 +199,11 @@ | |
| 199 | goto error; |
| 200 | } |
| 201 | |
| 202 | limit = json_find_option_int("limit",NULL,"n",-1); |
| 203 | |
| 204 | |
| 205 | /* Copy over report's SQL...*/ |
| 206 | blob_append(&sql, db_column_text(&q,0), -1); |
| 207 | zTitle = mprintf("%s", db_column_text(&q,1)); |
| 208 | db_finalize(&q); |
| 209 | db_prepare(&q, "%s", blob_sql_text(&sql)); |
| 210 |
+6
-6
| --- src/json_tag.c | ||
| +++ src/json_tag.c | ||
| @@ -79,11 +79,11 @@ | ||
| 79 | 79 | json_set_err(FSL_JSON_E_MISSING_ARGS, |
| 80 | 80 | "'name' parameter is missing."); |
| 81 | 81 | return NULL; |
| 82 | 82 | } |
| 83 | 83 | } |
| 84 | - | |
| 84 | + | |
| 85 | 85 | zCheckin = json_find_option_cstr("checkin",NULL,NULL); |
| 86 | 86 | if( !zCheckin ){ |
| 87 | 87 | if(!fossil_has_json()){ |
| 88 | 88 | zCheckin = json_command_arg(4); |
| 89 | 89 | } |
| @@ -163,11 +163,11 @@ | ||
| 163 | 163 | json_set_err(FSL_JSON_E_MISSING_ARGS, |
| 164 | 164 | "'name' parameter is missing."); |
| 165 | 165 | return NULL; |
| 166 | 166 | } |
| 167 | 167 | } |
| 168 | - | |
| 168 | + | |
| 169 | 169 | zCheckin = json_find_option_cstr("checkin",NULL,NULL); |
| 170 | 170 | if( !zCheckin ){ |
| 171 | 171 | if(!fossil_has_json()){ |
| 172 | 172 | zCheckin = json_command_arg(4); |
| 173 | 173 | } |
| @@ -232,15 +232,15 @@ | ||
| 232 | 232 | } |
| 233 | 233 | } |
| 234 | 234 | |
| 235 | 235 | limit = json_find_option_int("limit",NULL,"n",0); |
| 236 | 236 | fRaw = json_find_option_bool("raw",NULL,NULL,0); |
| 237 | - | |
| 237 | + | |
| 238 | 238 | tagid = db_int(0, "SELECT tagid FROM tag WHERE tagname='%s' || %Q", |
| 239 | 239 | fRaw ? "" : "sym-", |
| 240 | 240 | zName); |
| 241 | - | |
| 241 | + | |
| 242 | 242 | payV = cson_value_new_object(); |
| 243 | 243 | pay = cson_value_get_object(payV); |
| 244 | 244 | cson_object_set(pay, "name", json_new_string(zName)); |
| 245 | 245 | cson_object_set(pay, "raw", cson_value_new_bool(fRaw)); |
| 246 | 246 | cson_object_set(pay, "type", json_new_string(zType2)); |
| @@ -356,11 +356,11 @@ | ||
| 356 | 356 | if( zCheckin ){ |
| 357 | 357 | /** |
| 358 | 358 | Tags for a specific check-in. Output format: |
| 359 | 359 | |
| 360 | 360 | RAW mode: |
| 361 | - | |
| 361 | + | |
| 362 | 362 | { |
| 363 | 363 | "sym-tagname": (value || null), |
| 364 | 364 | ...other tags... |
| 365 | 365 | } |
| 366 | 366 | |
| @@ -412,11 +412,11 @@ | ||
| 412 | 412 | db_finalize(&q); |
| 413 | 413 | }else{/* all tags */ |
| 414 | 414 | /* Output format: |
| 415 | 415 | |
| 416 | 416 | RAW mode: |
| 417 | - | |
| 417 | + | |
| 418 | 418 | ["tagname", "sym-tagname2",...] |
| 419 | 419 | |
| 420 | 420 | Non-raw: |
| 421 | 421 | |
| 422 | 422 | ["tagname", "tagname2",...] |
| 423 | 423 |
| --- src/json_tag.c | |
| +++ src/json_tag.c | |
| @@ -79,11 +79,11 @@ | |
| 79 | json_set_err(FSL_JSON_E_MISSING_ARGS, |
| 80 | "'name' parameter is missing."); |
| 81 | return NULL; |
| 82 | } |
| 83 | } |
| 84 | |
| 85 | zCheckin = json_find_option_cstr("checkin",NULL,NULL); |
| 86 | if( !zCheckin ){ |
| 87 | if(!fossil_has_json()){ |
| 88 | zCheckin = json_command_arg(4); |
| 89 | } |
| @@ -163,11 +163,11 @@ | |
| 163 | json_set_err(FSL_JSON_E_MISSING_ARGS, |
| 164 | "'name' parameter is missing."); |
| 165 | return NULL; |
| 166 | } |
| 167 | } |
| 168 | |
| 169 | zCheckin = json_find_option_cstr("checkin",NULL,NULL); |
| 170 | if( !zCheckin ){ |
| 171 | if(!fossil_has_json()){ |
| 172 | zCheckin = json_command_arg(4); |
| 173 | } |
| @@ -232,15 +232,15 @@ | |
| 232 | } |
| 233 | } |
| 234 | |
| 235 | limit = json_find_option_int("limit",NULL,"n",0); |
| 236 | fRaw = json_find_option_bool("raw",NULL,NULL,0); |
| 237 | |
| 238 | tagid = db_int(0, "SELECT tagid FROM tag WHERE tagname='%s' || %Q", |
| 239 | fRaw ? "" : "sym-", |
| 240 | zName); |
| 241 | |
| 242 | payV = cson_value_new_object(); |
| 243 | pay = cson_value_get_object(payV); |
| 244 | cson_object_set(pay, "name", json_new_string(zName)); |
| 245 | cson_object_set(pay, "raw", cson_value_new_bool(fRaw)); |
| 246 | cson_object_set(pay, "type", json_new_string(zType2)); |
| @@ -356,11 +356,11 @@ | |
| 356 | if( zCheckin ){ |
| 357 | /** |
| 358 | Tags for a specific check-in. Output format: |
| 359 | |
| 360 | RAW mode: |
| 361 | |
| 362 | { |
| 363 | "sym-tagname": (value || null), |
| 364 | ...other tags... |
| 365 | } |
| 366 | |
| @@ -412,11 +412,11 @@ | |
| 412 | db_finalize(&q); |
| 413 | }else{/* all tags */ |
| 414 | /* Output format: |
| 415 | |
| 416 | RAW mode: |
| 417 | |
| 418 | ["tagname", "sym-tagname2",...] |
| 419 | |
| 420 | Non-raw: |
| 421 | |
| 422 | ["tagname", "tagname2",...] |
| 423 |
| --- src/json_tag.c | |
| +++ src/json_tag.c | |
| @@ -79,11 +79,11 @@ | |
| 79 | json_set_err(FSL_JSON_E_MISSING_ARGS, |
| 80 | "'name' parameter is missing."); |
| 81 | return NULL; |
| 82 | } |
| 83 | } |
| 84 | |
| 85 | zCheckin = json_find_option_cstr("checkin",NULL,NULL); |
| 86 | if( !zCheckin ){ |
| 87 | if(!fossil_has_json()){ |
| 88 | zCheckin = json_command_arg(4); |
| 89 | } |
| @@ -163,11 +163,11 @@ | |
| 163 | json_set_err(FSL_JSON_E_MISSING_ARGS, |
| 164 | "'name' parameter is missing."); |
| 165 | return NULL; |
| 166 | } |
| 167 | } |
| 168 | |
| 169 | zCheckin = json_find_option_cstr("checkin",NULL,NULL); |
| 170 | if( !zCheckin ){ |
| 171 | if(!fossil_has_json()){ |
| 172 | zCheckin = json_command_arg(4); |
| 173 | } |
| @@ -232,15 +232,15 @@ | |
| 232 | } |
| 233 | } |
| 234 | |
| 235 | limit = json_find_option_int("limit",NULL,"n",0); |
| 236 | fRaw = json_find_option_bool("raw",NULL,NULL,0); |
| 237 | |
| 238 | tagid = db_int(0, "SELECT tagid FROM tag WHERE tagname='%s' || %Q", |
| 239 | fRaw ? "" : "sym-", |
| 240 | zName); |
| 241 | |
| 242 | payV = cson_value_new_object(); |
| 243 | pay = cson_value_get_object(payV); |
| 244 | cson_object_set(pay, "name", json_new_string(zName)); |
| 245 | cson_object_set(pay, "raw", cson_value_new_bool(fRaw)); |
| 246 | cson_object_set(pay, "type", json_new_string(zType2)); |
| @@ -356,11 +356,11 @@ | |
| 356 | if( zCheckin ){ |
| 357 | /** |
| 358 | Tags for a specific check-in. Output format: |
| 359 | |
| 360 | RAW mode: |
| 361 | |
| 362 | { |
| 363 | "sym-tagname": (value || null), |
| 364 | ...other tags... |
| 365 | } |
| 366 | |
| @@ -412,11 +412,11 @@ | |
| 412 | db_finalize(&q); |
| 413 | }else{/* all tags */ |
| 414 | /* Output format: |
| 415 | |
| 416 | RAW mode: |
| 417 | |
| 418 | ["tagname", "sym-tagname2",...] |
| 419 | |
| 420 | Non-raw: |
| 421 | |
| 422 | ["tagname", "tagname2",...] |
| 423 |
+6
-6
| --- src/json_user.c | ||
| +++ src/json_user.c | ||
| @@ -69,11 +69,11 @@ | ||
| 69 | 69 | db_finalize(&q); |
| 70 | 70 | if(NULL == payV){ |
| 71 | 71 | json_set_err(FSL_JSON_E_UNKNOWN, |
| 72 | 72 | "Could not convert user list to JSON."); |
| 73 | 73 | } |
| 74 | - return payV; | |
| 74 | + return payV; | |
| 75 | 75 | } |
| 76 | 76 | |
| 77 | 77 | /* |
| 78 | 78 | ** Creates a new JSON Object based on the db state of |
| 79 | 79 | ** the given user name. On error (no record found) |
| @@ -93,11 +93,11 @@ | ||
| 93 | 93 | zName); |
| 94 | 94 | if( (SQLITE_ROW == db_step(&q)) ){ |
| 95 | 95 | u = cson_sqlite3_row_to_object(q.pStmt); |
| 96 | 96 | } |
| 97 | 97 | db_finalize(&q); |
| 98 | - return u; | |
| 98 | + return u; | |
| 99 | 99 | } |
| 100 | 100 | |
| 101 | 101 | /* |
| 102 | 102 | ** Identical to json_load_user_by_name(), but expects a user ID. Returns |
| 103 | 103 | ** NULL if no user found with that ID. |
| @@ -115,11 +115,11 @@ | ||
| 115 | 115 | uid); |
| 116 | 116 | if( (SQLITE_ROW == db_step(&q)) ){ |
| 117 | 117 | u = cson_sqlite3_row_to_object(q.pStmt); |
| 118 | 118 | } |
| 119 | 119 | db_finalize(&q); |
| 120 | - return u; | |
| 120 | + return u; | |
| 121 | 121 | } |
| 122 | 122 | |
| 123 | 123 | |
| 124 | 124 | /* |
| 125 | 125 | ** Impl of /json/user/get. Requires admin or setup rights. |
| @@ -139,11 +139,11 @@ | ||
| 139 | 139 | } |
| 140 | 140 | payV = json_load_user_by_name(pUser); |
| 141 | 141 | if(!payV){ |
| 142 | 142 | json_set_err(FSL_JSON_E_RESOURCE_NOT_FOUND,"User not found."); |
| 143 | 143 | } |
| 144 | - return payV; | |
| 144 | + return payV; | |
| 145 | 145 | } |
| 146 | 146 | |
| 147 | 147 | /* |
| 148 | 148 | ** Expects pUser to contain fossil user fields in JSON form: name, |
| 149 | 149 | ** uid, info, capabilities, password. |
| @@ -240,11 +240,11 @@ | ||
| 240 | 240 | } |
| 241 | 241 | |
| 242 | 242 | /* Maintenance note: all error-returns from here on out should go |
| 243 | 243 | via 'goto error' in order to clean up. |
| 244 | 244 | */ |
| 245 | - | |
| 245 | + | |
| 246 | 246 | if(uid != g.userUid){ |
| 247 | 247 | if(!g.perm.Admin && !g.perm.Setup){ |
| 248 | 248 | json_set_err(FSL_JSON_E_DENIED, |
| 249 | 249 | "Changing another user's data requires " |
| 250 | 250 | "'a' or 's' privileges."); |
| @@ -336,11 +336,11 @@ | ||
| 336 | 336 | if((g.perm.Admin || g.perm.Setup) |
| 337 | 337 | && forceLogout && cson_value_get_bool(forceLogout)){ |
| 338 | 338 | blob_append(&sql, ", cookie=NULL, cexpire=NULL", -1); |
| 339 | 339 | ++gotFields; |
| 340 | 340 | } |
| 341 | - | |
| 341 | + | |
| 342 | 342 | if(!gotFields){ |
| 343 | 343 | json_set_err( FSL_JSON_E_MISSING_ARGS, |
| 344 | 344 | "Required user data are missing."); |
| 345 | 345 | goto error; |
| 346 | 346 | } |
| 347 | 347 |
| --- src/json_user.c | |
| +++ src/json_user.c | |
| @@ -69,11 +69,11 @@ | |
| 69 | db_finalize(&q); |
| 70 | if(NULL == payV){ |
| 71 | json_set_err(FSL_JSON_E_UNKNOWN, |
| 72 | "Could not convert user list to JSON."); |
| 73 | } |
| 74 | return payV; |
| 75 | } |
| 76 | |
| 77 | /* |
| 78 | ** Creates a new JSON Object based on the db state of |
| 79 | ** the given user name. On error (no record found) |
| @@ -93,11 +93,11 @@ | |
| 93 | zName); |
| 94 | if( (SQLITE_ROW == db_step(&q)) ){ |
| 95 | u = cson_sqlite3_row_to_object(q.pStmt); |
| 96 | } |
| 97 | db_finalize(&q); |
| 98 | return u; |
| 99 | } |
| 100 | |
| 101 | /* |
| 102 | ** Identical to json_load_user_by_name(), but expects a user ID. Returns |
| 103 | ** NULL if no user found with that ID. |
| @@ -115,11 +115,11 @@ | |
| 115 | uid); |
| 116 | if( (SQLITE_ROW == db_step(&q)) ){ |
| 117 | u = cson_sqlite3_row_to_object(q.pStmt); |
| 118 | } |
| 119 | db_finalize(&q); |
| 120 | return u; |
| 121 | } |
| 122 | |
| 123 | |
| 124 | /* |
| 125 | ** Impl of /json/user/get. Requires admin or setup rights. |
| @@ -139,11 +139,11 @@ | |
| 139 | } |
| 140 | payV = json_load_user_by_name(pUser); |
| 141 | if(!payV){ |
| 142 | json_set_err(FSL_JSON_E_RESOURCE_NOT_FOUND,"User not found."); |
| 143 | } |
| 144 | return payV; |
| 145 | } |
| 146 | |
| 147 | /* |
| 148 | ** Expects pUser to contain fossil user fields in JSON form: name, |
| 149 | ** uid, info, capabilities, password. |
| @@ -240,11 +240,11 @@ | |
| 240 | } |
| 241 | |
| 242 | /* Maintenance note: all error-returns from here on out should go |
| 243 | via 'goto error' in order to clean up. |
| 244 | */ |
| 245 | |
| 246 | if(uid != g.userUid){ |
| 247 | if(!g.perm.Admin && !g.perm.Setup){ |
| 248 | json_set_err(FSL_JSON_E_DENIED, |
| 249 | "Changing another user's data requires " |
| 250 | "'a' or 's' privileges."); |
| @@ -336,11 +336,11 @@ | |
| 336 | if((g.perm.Admin || g.perm.Setup) |
| 337 | && forceLogout && cson_value_get_bool(forceLogout)){ |
| 338 | blob_append(&sql, ", cookie=NULL, cexpire=NULL", -1); |
| 339 | ++gotFields; |
| 340 | } |
| 341 | |
| 342 | if(!gotFields){ |
| 343 | json_set_err( FSL_JSON_E_MISSING_ARGS, |
| 344 | "Required user data are missing."); |
| 345 | goto error; |
| 346 | } |
| 347 |
| --- src/json_user.c | |
| +++ src/json_user.c | |
| @@ -69,11 +69,11 @@ | |
| 69 | db_finalize(&q); |
| 70 | if(NULL == payV){ |
| 71 | json_set_err(FSL_JSON_E_UNKNOWN, |
| 72 | "Could not convert user list to JSON."); |
| 73 | } |
| 74 | return payV; |
| 75 | } |
| 76 | |
| 77 | /* |
| 78 | ** Creates a new JSON Object based on the db state of |
| 79 | ** the given user name. On error (no record found) |
| @@ -93,11 +93,11 @@ | |
| 93 | zName); |
| 94 | if( (SQLITE_ROW == db_step(&q)) ){ |
| 95 | u = cson_sqlite3_row_to_object(q.pStmt); |
| 96 | } |
| 97 | db_finalize(&q); |
| 98 | return u; |
| 99 | } |
| 100 | |
| 101 | /* |
| 102 | ** Identical to json_load_user_by_name(), but expects a user ID. Returns |
| 103 | ** NULL if no user found with that ID. |
| @@ -115,11 +115,11 @@ | |
| 115 | uid); |
| 116 | if( (SQLITE_ROW == db_step(&q)) ){ |
| 117 | u = cson_sqlite3_row_to_object(q.pStmt); |
| 118 | } |
| 119 | db_finalize(&q); |
| 120 | return u; |
| 121 | } |
| 122 | |
| 123 | |
| 124 | /* |
| 125 | ** Impl of /json/user/get. Requires admin or setup rights. |
| @@ -139,11 +139,11 @@ | |
| 139 | } |
| 140 | payV = json_load_user_by_name(pUser); |
| 141 | if(!payV){ |
| 142 | json_set_err(FSL_JSON_E_RESOURCE_NOT_FOUND,"User not found."); |
| 143 | } |
| 144 | return payV; |
| 145 | } |
| 146 | |
| 147 | /* |
| 148 | ** Expects pUser to contain fossil user fields in JSON form: name, |
| 149 | ** uid, info, capabilities, password. |
| @@ -240,11 +240,11 @@ | |
| 240 | } |
| 241 | |
| 242 | /* Maintenance note: all error-returns from here on out should go |
| 243 | via 'goto error' in order to clean up. |
| 244 | */ |
| 245 | |
| 246 | if(uid != g.userUid){ |
| 247 | if(!g.perm.Admin && !g.perm.Setup){ |
| 248 | json_set_err(FSL_JSON_E_DENIED, |
| 249 | "Changing another user's data requires " |
| 250 | "'a' or 's' privileges."); |
| @@ -336,11 +336,11 @@ | |
| 336 | if((g.perm.Admin || g.perm.Setup) |
| 337 | && forceLogout && cson_value_get_bool(forceLogout)){ |
| 338 | blob_append(&sql, ", cookie=NULL, cexpire=NULL", -1); |
| 339 | ++gotFields; |
| 340 | } |
| 341 | |
| 342 | if(!gotFields){ |
| 343 | json_set_err( FSL_JSON_E_MISSING_ARGS, |
| 344 | "Required user data are missing."); |
| 345 | goto error; |
| 346 | } |
| 347 |
+8
-8
| --- src/json_wiki.c | ||
| +++ src/json_wiki.c | ||
| @@ -155,11 +155,11 @@ | ||
| 155 | 155 | } |
| 156 | 156 | /*TODO: add 'T' (tag) fields*/ |
| 157 | 157 | /*TODO: add the 'A' card (file attachment) entries?*/ |
| 158 | 158 | manifest_destroy(pWiki); |
| 159 | 159 | return cson_object_value(pay); |
| 160 | - } | |
| 160 | + } | |
| 161 | 161 | } |
| 162 | 162 | |
| 163 | 163 | /* |
| 164 | 164 | ** Searches for the latest version of a wiki page with the given |
| 165 | 165 | ** name. If found it behaves like json_get_wiki_page_by_rid(theRid, |
| @@ -170,11 +170,11 @@ | ||
| 170 | 170 | rid = db_int(0, |
| 171 | 171 | "SELECT x.rid FROM tag t, tagxref x, blob b" |
| 172 | 172 | " WHERE x.tagid=t.tagid AND t.tagname='wiki-%q' " |
| 173 | 173 | " AND b.rid=x.rid" |
| 174 | 174 | " ORDER BY x.mtime DESC LIMIT 1", |
| 175 | - zPageName | |
| 175 | + zPageName | |
| 176 | 176 | ); |
| 177 | 177 | if( 0==rid ){ |
| 178 | 178 | json_set_err( FSL_JSON_E_RESOURCE_NOT_FOUND, "Wiki page not found: %s", |
| 179 | 179 | zPageName ); |
| 180 | 180 | return NULL; |
| @@ -256,21 +256,21 @@ | ||
| 256 | 256 | return NULL; |
| 257 | 257 | } |
| 258 | 258 | zPageName = json_find_option_cstr2("name",NULL,"n",g.json.dispatchDepth+1); |
| 259 | 259 | |
| 260 | 260 | zSymName = json_find_option_cstr("uuid",NULL,"u"); |
| 261 | - | |
| 261 | + | |
| 262 | 262 | if((!zPageName||!*zPageName) && (!zSymName || !*zSymName)){ |
| 263 | 263 | json_set_err(FSL_JSON_E_MISSING_ARGS, |
| 264 | 264 | "At least one of the 'name' or 'uuid' arguments must be provided."); |
| 265 | 265 | return NULL; |
| 266 | 266 | } |
| 267 | 267 | |
| 268 | 268 | /* TODO: see if we have a page named zPageName. If not, try to resolve |
| 269 | 269 | zPageName as a UUID. |
| 270 | 270 | */ |
| 271 | - | |
| 271 | + | |
| 272 | 272 | contentFormat = json_wiki_get_content_format_flag(contentFormat); |
| 273 | 273 | return json_wiki_get_by_name_or_symname( zPageName, zSymName, contentFormat ); |
| 274 | 274 | } |
| 275 | 275 | |
| 276 | 276 | /* |
| @@ -524,19 +524,19 @@ | ||
| 524 | 524 | json_set_err(FSL_JSON_E_DENIED, |
| 525 | 525 | "Requires 'h' permissions."); |
| 526 | 526 | return NULL; |
| 527 | 527 | } |
| 528 | 528 | |
| 529 | - | |
| 529 | + | |
| 530 | 530 | zV1 = json_find_option_cstr2( "v1",NULL, NULL, ++argPos ); |
| 531 | 531 | zV2 = json_find_option_cstr2( "v2",NULL, NULL, ++argPos ); |
| 532 | 532 | if(!zV1 || !*zV1 || !zV2 || !*zV2) { |
| 533 | 533 | json_set_err(FSL_JSON_E_INVALID_ARGS, |
| 534 | 534 | "Requires both 'v1' and 'v2' arguments."); |
| 535 | 535 | return NULL; |
| 536 | 536 | } |
| 537 | - | |
| 537 | + | |
| 538 | 538 | r1 = symbolic_name_to_rid( zV1, "w" ); |
| 539 | 539 | zErrTag = zV1; |
| 540 | 540 | if(r1<0){ |
| 541 | 541 | goto ambiguous; |
| 542 | 542 | }else if(0==r1){ |
| @@ -570,11 +570,11 @@ | ||
| 570 | 570 | text_diff(&w1, &w2, &d, 0, diffFlags); |
| 571 | 571 | blob_reset(&w1); |
| 572 | 572 | blob_reset(&w2); |
| 573 | 573 | |
| 574 | 574 | pay = cson_new_object(); |
| 575 | - | |
| 575 | + | |
| 576 | 576 | zUuid = json_wiki_get_uuid_for_rid( pW1->rid ); |
| 577 | 577 | cson_object_set(pay, "v1", json_new_string(zUuid) ); |
| 578 | 578 | free(zUuid); |
| 579 | 579 | zUuid = json_wiki_get_uuid_for_rid( pW2->rid ); |
| 580 | 580 | cson_object_set(pay, "v2", json_new_string(zUuid) ); |
| @@ -585,11 +585,11 @@ | ||
| 585 | 585 | manifest_destroy(pW2); |
| 586 | 586 | |
| 587 | 587 | cson_object_set(pay, "diff", |
| 588 | 588 | cson_value_new_string( blob_str(&d), |
| 589 | 589 | (unsigned int)blob_size(&d))); |
| 590 | - | |
| 590 | + | |
| 591 | 591 | return cson_object_value(pay); |
| 592 | 592 | |
| 593 | 593 | manifest: |
| 594 | 594 | json_set_err(FSL_JSON_E_UNKNOWN, |
| 595 | 595 | "Could not load wiki manifest for UUID [%s].", |
| 596 | 596 |
| --- src/json_wiki.c | |
| +++ src/json_wiki.c | |
| @@ -155,11 +155,11 @@ | |
| 155 | } |
| 156 | /*TODO: add 'T' (tag) fields*/ |
| 157 | /*TODO: add the 'A' card (file attachment) entries?*/ |
| 158 | manifest_destroy(pWiki); |
| 159 | return cson_object_value(pay); |
| 160 | } |
| 161 | } |
| 162 | |
| 163 | /* |
| 164 | ** Searches for the latest version of a wiki page with the given |
| 165 | ** name. If found it behaves like json_get_wiki_page_by_rid(theRid, |
| @@ -170,11 +170,11 @@ | |
| 170 | rid = db_int(0, |
| 171 | "SELECT x.rid FROM tag t, tagxref x, blob b" |
| 172 | " WHERE x.tagid=t.tagid AND t.tagname='wiki-%q' " |
| 173 | " AND b.rid=x.rid" |
| 174 | " ORDER BY x.mtime DESC LIMIT 1", |
| 175 | zPageName |
| 176 | ); |
| 177 | if( 0==rid ){ |
| 178 | json_set_err( FSL_JSON_E_RESOURCE_NOT_FOUND, "Wiki page not found: %s", |
| 179 | zPageName ); |
| 180 | return NULL; |
| @@ -256,21 +256,21 @@ | |
| 256 | return NULL; |
| 257 | } |
| 258 | zPageName = json_find_option_cstr2("name",NULL,"n",g.json.dispatchDepth+1); |
| 259 | |
| 260 | zSymName = json_find_option_cstr("uuid",NULL,"u"); |
| 261 | |
| 262 | if((!zPageName||!*zPageName) && (!zSymName || !*zSymName)){ |
| 263 | json_set_err(FSL_JSON_E_MISSING_ARGS, |
| 264 | "At least one of the 'name' or 'uuid' arguments must be provided."); |
| 265 | return NULL; |
| 266 | } |
| 267 | |
| 268 | /* TODO: see if we have a page named zPageName. If not, try to resolve |
| 269 | zPageName as a UUID. |
| 270 | */ |
| 271 | |
| 272 | contentFormat = json_wiki_get_content_format_flag(contentFormat); |
| 273 | return json_wiki_get_by_name_or_symname( zPageName, zSymName, contentFormat ); |
| 274 | } |
| 275 | |
| 276 | /* |
| @@ -524,19 +524,19 @@ | |
| 524 | json_set_err(FSL_JSON_E_DENIED, |
| 525 | "Requires 'h' permissions."); |
| 526 | return NULL; |
| 527 | } |
| 528 | |
| 529 | |
| 530 | zV1 = json_find_option_cstr2( "v1",NULL, NULL, ++argPos ); |
| 531 | zV2 = json_find_option_cstr2( "v2",NULL, NULL, ++argPos ); |
| 532 | if(!zV1 || !*zV1 || !zV2 || !*zV2) { |
| 533 | json_set_err(FSL_JSON_E_INVALID_ARGS, |
| 534 | "Requires both 'v1' and 'v2' arguments."); |
| 535 | return NULL; |
| 536 | } |
| 537 | |
| 538 | r1 = symbolic_name_to_rid( zV1, "w" ); |
| 539 | zErrTag = zV1; |
| 540 | if(r1<0){ |
| 541 | goto ambiguous; |
| 542 | }else if(0==r1){ |
| @@ -570,11 +570,11 @@ | |
| 570 | text_diff(&w1, &w2, &d, 0, diffFlags); |
| 571 | blob_reset(&w1); |
| 572 | blob_reset(&w2); |
| 573 | |
| 574 | pay = cson_new_object(); |
| 575 | |
| 576 | zUuid = json_wiki_get_uuid_for_rid( pW1->rid ); |
| 577 | cson_object_set(pay, "v1", json_new_string(zUuid) ); |
| 578 | free(zUuid); |
| 579 | zUuid = json_wiki_get_uuid_for_rid( pW2->rid ); |
| 580 | cson_object_set(pay, "v2", json_new_string(zUuid) ); |
| @@ -585,11 +585,11 @@ | |
| 585 | manifest_destroy(pW2); |
| 586 | |
| 587 | cson_object_set(pay, "diff", |
| 588 | cson_value_new_string( blob_str(&d), |
| 589 | (unsigned int)blob_size(&d))); |
| 590 | |
| 591 | return cson_object_value(pay); |
| 592 | |
| 593 | manifest: |
| 594 | json_set_err(FSL_JSON_E_UNKNOWN, |
| 595 | "Could not load wiki manifest for UUID [%s].", |
| 596 |
| --- src/json_wiki.c | |
| +++ src/json_wiki.c | |
| @@ -155,11 +155,11 @@ | |
| 155 | } |
| 156 | /*TODO: add 'T' (tag) fields*/ |
| 157 | /*TODO: add the 'A' card (file attachment) entries?*/ |
| 158 | manifest_destroy(pWiki); |
| 159 | return cson_object_value(pay); |
| 160 | } |
| 161 | } |
| 162 | |
| 163 | /* |
| 164 | ** Searches for the latest version of a wiki page with the given |
| 165 | ** name. If found it behaves like json_get_wiki_page_by_rid(theRid, |
| @@ -170,11 +170,11 @@ | |
| 170 | rid = db_int(0, |
| 171 | "SELECT x.rid FROM tag t, tagxref x, blob b" |
| 172 | " WHERE x.tagid=t.tagid AND t.tagname='wiki-%q' " |
| 173 | " AND b.rid=x.rid" |
| 174 | " ORDER BY x.mtime DESC LIMIT 1", |
| 175 | zPageName |
| 176 | ); |
| 177 | if( 0==rid ){ |
| 178 | json_set_err( FSL_JSON_E_RESOURCE_NOT_FOUND, "Wiki page not found: %s", |
| 179 | zPageName ); |
| 180 | return NULL; |
| @@ -256,21 +256,21 @@ | |
| 256 | return NULL; |
| 257 | } |
| 258 | zPageName = json_find_option_cstr2("name",NULL,"n",g.json.dispatchDepth+1); |
| 259 | |
| 260 | zSymName = json_find_option_cstr("uuid",NULL,"u"); |
| 261 | |
| 262 | if((!zPageName||!*zPageName) && (!zSymName || !*zSymName)){ |
| 263 | json_set_err(FSL_JSON_E_MISSING_ARGS, |
| 264 | "At least one of the 'name' or 'uuid' arguments must be provided."); |
| 265 | return NULL; |
| 266 | } |
| 267 | |
| 268 | /* TODO: see if we have a page named zPageName. If not, try to resolve |
| 269 | zPageName as a UUID. |
| 270 | */ |
| 271 | |
| 272 | contentFormat = json_wiki_get_content_format_flag(contentFormat); |
| 273 | return json_wiki_get_by_name_or_symname( zPageName, zSymName, contentFormat ); |
| 274 | } |
| 275 | |
| 276 | /* |
| @@ -524,19 +524,19 @@ | |
| 524 | json_set_err(FSL_JSON_E_DENIED, |
| 525 | "Requires 'h' permissions."); |
| 526 | return NULL; |
| 527 | } |
| 528 | |
| 529 | |
| 530 | zV1 = json_find_option_cstr2( "v1",NULL, NULL, ++argPos ); |
| 531 | zV2 = json_find_option_cstr2( "v2",NULL, NULL, ++argPos ); |
| 532 | if(!zV1 || !*zV1 || !zV2 || !*zV2) { |
| 533 | json_set_err(FSL_JSON_E_INVALID_ARGS, |
| 534 | "Requires both 'v1' and 'v2' arguments."); |
| 535 | return NULL; |
| 536 | } |
| 537 | |
| 538 | r1 = symbolic_name_to_rid( zV1, "w" ); |
| 539 | zErrTag = zV1; |
| 540 | if(r1<0){ |
| 541 | goto ambiguous; |
| 542 | }else if(0==r1){ |
| @@ -570,11 +570,11 @@ | |
| 570 | text_diff(&w1, &w2, &d, 0, diffFlags); |
| 571 | blob_reset(&w1); |
| 572 | blob_reset(&w2); |
| 573 | |
| 574 | pay = cson_new_object(); |
| 575 | |
| 576 | zUuid = json_wiki_get_uuid_for_rid( pW1->rid ); |
| 577 | cson_object_set(pay, "v1", json_new_string(zUuid) ); |
| 578 | free(zUuid); |
| 579 | zUuid = json_wiki_get_uuid_for_rid( pW2->rid ); |
| 580 | cson_object_set(pay, "v2", json_new_string(zUuid) ); |
| @@ -585,11 +585,11 @@ | |
| 585 | manifest_destroy(pW2); |
| 586 | |
| 587 | cson_object_set(pay, "diff", |
| 588 | cson_value_new_string( blob_str(&d), |
| 589 | (unsigned int)blob_size(&d))); |
| 590 | |
| 591 | return cson_object_value(pay); |
| 592 | |
| 593 | manifest: |
| 594 | json_set_err(FSL_JSON_E_UNKNOWN, |
| 595 | "Could not load wiki manifest for UUID [%s].", |
| 596 |
+1
-1
| --- src/main.c | ||
| +++ src/main.c | ||
| @@ -1616,11 +1616,11 @@ | ||
| 1616 | 1616 | zNotFound = azRedirect[i*2+1]; |
| 1617 | 1617 | continue; |
| 1618 | 1618 | } |
| 1619 | 1619 | db_open_repository(azRedirect[i*2]); |
| 1620 | 1620 | if( db_exists("SELECT 1 FROM blob WHERE uuid GLOB '%q*'", zName) || |
| 1621 | - db_exists("SELECT 1 FROM ticket WHERE tkt_uuid GLOB '%q*'", zName) ){ | |
| 1621 | + db_exists("SELECT 1 FROM ticket WHERE tkt_uuid GLOB '%q*'", zName) ){ | |
| 1622 | 1622 | cgi_redirectf(azRedirect[i*2+1] /*works-like:"%s"*/, zName); |
| 1623 | 1623 | return; |
| 1624 | 1624 | } |
| 1625 | 1625 | db_close(1); |
| 1626 | 1626 | } |
| 1627 | 1627 |
| --- src/main.c | |
| +++ src/main.c | |
| @@ -1616,11 +1616,11 @@ | |
| 1616 | zNotFound = azRedirect[i*2+1]; |
| 1617 | continue; |
| 1618 | } |
| 1619 | db_open_repository(azRedirect[i*2]); |
| 1620 | if( db_exists("SELECT 1 FROM blob WHERE uuid GLOB '%q*'", zName) || |
| 1621 | db_exists("SELECT 1 FROM ticket WHERE tkt_uuid GLOB '%q*'", zName) ){ |
| 1622 | cgi_redirectf(azRedirect[i*2+1] /*works-like:"%s"*/, zName); |
| 1623 | return; |
| 1624 | } |
| 1625 | db_close(1); |
| 1626 | } |
| 1627 |
| --- src/main.c | |
| +++ src/main.c | |
| @@ -1616,11 +1616,11 @@ | |
| 1616 | zNotFound = azRedirect[i*2+1]; |
| 1617 | continue; |
| 1618 | } |
| 1619 | db_open_repository(azRedirect[i*2]); |
| 1620 | if( db_exists("SELECT 1 FROM blob WHERE uuid GLOB '%q*'", zName) || |
| 1621 | db_exists("SELECT 1 FROM ticket WHERE tkt_uuid GLOB '%q*'", zName) ){ |
| 1622 | cgi_redirectf(azRedirect[i*2+1] /*works-like:"%s"*/, zName); |
| 1623 | return; |
| 1624 | } |
| 1625 | db_close(1); |
| 1626 | } |
| 1627 |
+1
-1
| --- src/makeheaders.html | ||
| +++ src/makeheaders.html | ||
| @@ -1100,11 +1100,11 @@ | ||
| 1100 | 1100 | <a name="H0017"></a> |
| 1101 | 1101 | <h2>6.0 History</h2> |
| 1102 | 1102 | |
| 1103 | 1103 | <p> |
| 1104 | 1104 | The makeheaders program was first written by D. Richard Hipp |
| 1105 | -(also the original author of | |
| 1105 | +(also the original author of | |
| 1106 | 1106 | <a href="https://sqlite.org/">SQLite</a> and |
| 1107 | 1107 | <a href="https://www.fossil-scm.org/">Fossil</a>) in 1993. |
| 1108 | 1108 | Hipp open-sourced the project immediately, but it never caught |
| 1109 | 1109 | on with any other developers and it continued to be used mostly |
| 1110 | 1110 | by Hipp himself for over a decade. When Hipp was first writing |
| 1111 | 1111 |
| --- src/makeheaders.html | |
| +++ src/makeheaders.html | |
| @@ -1100,11 +1100,11 @@ | |
| 1100 | <a name="H0017"></a> |
| 1101 | <h2>6.0 History</h2> |
| 1102 | |
| 1103 | <p> |
| 1104 | The makeheaders program was first written by D. Richard Hipp |
| 1105 | (also the original author of |
| 1106 | <a href="https://sqlite.org/">SQLite</a> and |
| 1107 | <a href="https://www.fossil-scm.org/">Fossil</a>) in 1993. |
| 1108 | Hipp open-sourced the project immediately, but it never caught |
| 1109 | on with any other developers and it continued to be used mostly |
| 1110 | by Hipp himself for over a decade. When Hipp was first writing |
| 1111 |
| --- src/makeheaders.html | |
| +++ src/makeheaders.html | |
| @@ -1100,11 +1100,11 @@ | |
| 1100 | <a name="H0017"></a> |
| 1101 | <h2>6.0 History</h2> |
| 1102 | |
| 1103 | <p> |
| 1104 | The makeheaders program was first written by D. Richard Hipp |
| 1105 | (also the original author of |
| 1106 | <a href="https://sqlite.org/">SQLite</a> and |
| 1107 | <a href="https://www.fossil-scm.org/">Fossil</a>) in 1993. |
| 1108 | Hipp open-sourced the project immediately, but it never caught |
| 1109 | on with any other developers and it continued to be used mostly |
| 1110 | by Hipp himself for over a decade. When Hipp was first writing |
| 1111 |
+1
-1
| --- src/printf.c | ||
| +++ src/printf.c | ||
| @@ -650,11 +650,11 @@ | ||
| 650 | 650 | if( bufpt==0 ){ |
| 651 | 651 | bufpt = ""; |
| 652 | 652 | }else if( xtype==etDYNSTRING ){ |
| 653 | 653 | zExtra = bufpt; |
| 654 | 654 | }else if( xtype==etSTRINGID ){ |
| 655 | - precision = hashDigits(flag_altform2); | |
| 655 | + precision = hashDigits(flag_altform2); | |
| 656 | 656 | } |
| 657 | 657 | length = StrNLen32(bufpt, limit); |
| 658 | 658 | if( precision>=0 && precision<length ) length = precision; |
| 659 | 659 | break; |
| 660 | 660 | } |
| 661 | 661 |
| --- src/printf.c | |
| +++ src/printf.c | |
| @@ -650,11 +650,11 @@ | |
| 650 | if( bufpt==0 ){ |
| 651 | bufpt = ""; |
| 652 | }else if( xtype==etDYNSTRING ){ |
| 653 | zExtra = bufpt; |
| 654 | }else if( xtype==etSTRINGID ){ |
| 655 | precision = hashDigits(flag_altform2); |
| 656 | } |
| 657 | length = StrNLen32(bufpt, limit); |
| 658 | if( precision>=0 && precision<length ) length = precision; |
| 659 | break; |
| 660 | } |
| 661 |
| --- src/printf.c | |
| +++ src/printf.c | |
| @@ -650,11 +650,11 @@ | |
| 650 | if( bufpt==0 ){ |
| 651 | bufpt = ""; |
| 652 | }else if( xtype==etDYNSTRING ){ |
| 653 | zExtra = bufpt; |
| 654 | }else if( xtype==etSTRINGID ){ |
| 655 | precision = hashDigits(flag_altform2); |
| 656 | } |
| 657 | length = StrNLen32(bufpt, limit); |
| 658 | if( precision>=0 && precision<length ) length = precision; |
| 659 | break; |
| 660 | } |
| 661 |
+1
-1
| --- test/diff-test-1.wiki | ||
| +++ test/diff-test-1.wiki | ||
| @@ -1,9 +1,9 @@ | ||
| 1 | 1 | <title>Graph Test One</title> |
| 2 | 2 | |
| 3 | 3 | This page contains list of URLs of interesting diffs. |
| 4 | -Click on all URLs, one by one, to verify | |
| 4 | +Click on all URLs, one by one, to verify | |
| 5 | 5 | the correct operation of the diff logic. |
| 6 | 6 | |
| 7 | 7 | * <a href="../../../info/030035345c#chunk73" target="testwindow"> |
| 8 | 8 | Multiple edits on a single line.</a> This is an SQLite version |
| 9 | 9 | update diff. It is a large diff and contains many other interesting |
| 10 | 10 |
| --- test/diff-test-1.wiki | |
| +++ test/diff-test-1.wiki | |
| @@ -1,9 +1,9 @@ | |
| 1 | <title>Graph Test One</title> |
| 2 | |
| 3 | This page contains list of URLs of interesting diffs. |
| 4 | Click on all URLs, one by one, to verify |
| 5 | the correct operation of the diff logic. |
| 6 | |
| 7 | * <a href="../../../info/030035345c#chunk73" target="testwindow"> |
| 8 | Multiple edits on a single line.</a> This is an SQLite version |
| 9 | update diff. It is a large diff and contains many other interesting |
| 10 |
| --- test/diff-test-1.wiki | |
| +++ test/diff-test-1.wiki | |
| @@ -1,9 +1,9 @@ | |
| 1 | <title>Graph Test One</title> |
| 2 | |
| 3 | This page contains list of URLs of interesting diffs. |
| 4 | Click on all URLs, one by one, to verify |
| 5 | the correct operation of the diff logic. |
| 6 | |
| 7 | * <a href="../../../info/030035345c#chunk73" target="testwindow"> |
| 8 | Multiple edits on a single line.</a> This is an SQLite version |
| 9 | update diff. It is a large diff and contains many other interesting |
| 10 |
+2
-2
| --- test/merge1.test | ||
| +++ test/merge1.test | ||
| @@ -337,11 +337,11 @@ | ||
| 337 | 337 | |
| 338 | 338 | write_file_indented t2 { |
| 339 | 339 | abcd |
| 340 | 340 | efgh 2 |
| 341 | 341 | ijkl 2 |
| 342 | - mnop | |
| 342 | + mnop | |
| 343 | 343 | qrst |
| 344 | 344 | uvwx |
| 345 | 345 | yzAB 2 |
| 346 | 346 | CDEF 2 |
| 347 | 347 | GHIJ 2 |
| @@ -368,11 +368,11 @@ | ||
| 368 | 368 | write_file_indented t23 { |
| 369 | 369 | abcd |
| 370 | 370 | <<<<<<< BEGIN MERGE CONFLICT: local copy shown first <<<<<<<<<<<<<<< |
| 371 | 371 | efgh 2 |
| 372 | 372 | ijkl 2 |
| 373 | - mnop | |
| 373 | + mnop | |
| 374 | 374 | qrst |
| 375 | 375 | uvwx |
| 376 | 376 | yzAB 2 |
| 377 | 377 | CDEF 2 |
| 378 | 378 | GHIJ 2 |
| 379 | 379 |
| --- test/merge1.test | |
| +++ test/merge1.test | |
| @@ -337,11 +337,11 @@ | |
| 337 | |
| 338 | write_file_indented t2 { |
| 339 | abcd |
| 340 | efgh 2 |
| 341 | ijkl 2 |
| 342 | mnop |
| 343 | qrst |
| 344 | uvwx |
| 345 | yzAB 2 |
| 346 | CDEF 2 |
| 347 | GHIJ 2 |
| @@ -368,11 +368,11 @@ | |
| 368 | write_file_indented t23 { |
| 369 | abcd |
| 370 | <<<<<<< BEGIN MERGE CONFLICT: local copy shown first <<<<<<<<<<<<<<< |
| 371 | efgh 2 |
| 372 | ijkl 2 |
| 373 | mnop |
| 374 | qrst |
| 375 | uvwx |
| 376 | yzAB 2 |
| 377 | CDEF 2 |
| 378 | GHIJ 2 |
| 379 |
| --- test/merge1.test | |
| +++ test/merge1.test | |
| @@ -337,11 +337,11 @@ | |
| 337 | |
| 338 | write_file_indented t2 { |
| 339 | abcd |
| 340 | efgh 2 |
| 341 | ijkl 2 |
| 342 | mnop |
| 343 | qrst |
| 344 | uvwx |
| 345 | yzAB 2 |
| 346 | CDEF 2 |
| 347 | GHIJ 2 |
| @@ -368,11 +368,11 @@ | |
| 368 | write_file_indented t23 { |
| 369 | abcd |
| 370 | <<<<<<< BEGIN MERGE CONFLICT: local copy shown first <<<<<<<<<<<<<<< |
| 371 | efgh 2 |
| 372 | ijkl 2 |
| 373 | mnop |
| 374 | qrst |
| 375 | uvwx |
| 376 | yzAB 2 |
| 377 | CDEF 2 |
| 378 | GHIJ 2 |
| 379 |
+1
-1
| --- test/merge3.test | ||
| +++ test/merge3.test | ||
| @@ -295,11 +295,11 @@ | ||
| 295 | 295 | } { |
| 296 | 296 | 6 7 8 |
| 297 | 297 | } { |
| 298 | 298 | 2 3 4 5 |
| 299 | 299 | } { |
| 300 | - | |
| 300 | + | |
| 301 | 301 | } |
| 302 | 302 | merge-test 44 { |
| 303 | 303 | 2 3 4 5 6 7 8 |
| 304 | 304 | } { |
| 305 | 305 | 6 7 8 |
| 306 | 306 |
| --- test/merge3.test | |
| +++ test/merge3.test | |
| @@ -295,11 +295,11 @@ | |
| 295 | } { |
| 296 | 6 7 8 |
| 297 | } { |
| 298 | 2 3 4 5 |
| 299 | } { |
| 300 | |
| 301 | } |
| 302 | merge-test 44 { |
| 303 | 2 3 4 5 6 7 8 |
| 304 | } { |
| 305 | 6 7 8 |
| 306 |
| --- test/merge3.test | |
| +++ test/merge3.test | |
| @@ -295,11 +295,11 @@ | |
| 295 | } { |
| 296 | 6 7 8 |
| 297 | } { |
| 298 | 2 3 4 5 |
| 299 | } { |
| 300 | |
| 301 | } |
| 302 | merge-test 44 { |
| 303 | 2 3 4 5 6 7 8 |
| 304 | } { |
| 305 | 6 7 8 |
| 306 |
+1
-1
| --- test/merge5.test | ||
| +++ test/merge5.test | ||
| @@ -33,11 +33,11 @@ | ||
| 33 | 33 | protOut " Expected:\n $expected" |
| 34 | 34 | protOut " Got:\n $result" |
| 35 | 35 | test merge5-$testid 0 |
| 36 | 36 | } else { |
| 37 | 37 | test merge5-$testid 1 |
| 38 | - } | |
| 38 | + } | |
| 39 | 39 | } |
| 40 | 40 | |
| 41 | 41 | require_no_open_checkout; test_setup "" |
| 42 | 42 | |
| 43 | 43 | # Construct a test repository |
| 44 | 44 |
| --- test/merge5.test | |
| +++ test/merge5.test | |
| @@ -33,11 +33,11 @@ | |
| 33 | protOut " Expected:\n $expected" |
| 34 | protOut " Got:\n $result" |
| 35 | test merge5-$testid 0 |
| 36 | } else { |
| 37 | test merge5-$testid 1 |
| 38 | } |
| 39 | } |
| 40 | |
| 41 | require_no_open_checkout; test_setup "" |
| 42 | |
| 43 | # Construct a test repository |
| 44 |
| --- test/merge5.test | |
| +++ test/merge5.test | |
| @@ -33,11 +33,11 @@ | |
| 33 | protOut " Expected:\n $expected" |
| 34 | protOut " Got:\n $result" |
| 35 | test merge5-$testid 0 |
| 36 | } else { |
| 37 | test merge5-$testid 1 |
| 38 | } |
| 39 | } |
| 40 | |
| 41 | require_no_open_checkout; test_setup "" |
| 42 | |
| 43 | # Construct a test repository |
| 44 |
+1
-1
| --- test/revert.test | ||
| +++ test/revert.test | ||
| @@ -15,11 +15,11 @@ | ||
| 15 | 15 | # |
| 16 | 16 | ############################################################################ |
| 17 | 17 | # |
| 18 | 18 | # |
| 19 | 19 | # Tests for 'fossil revert' |
| 20 | -# | |
| 20 | +# | |
| 21 | 21 | # |
| 22 | 22 | |
| 23 | 23 | # Test 'fossil revert' against expected results from 'fossil changes' and |
| 24 | 24 | # 'fossil addremove -n', as well as by verifying the existence of files |
| 25 | 25 | # on the file system. 'fossil undo' is called after each test |
| 26 | 26 |
| --- test/revert.test | |
| +++ test/revert.test | |
| @@ -15,11 +15,11 @@ | |
| 15 | # |
| 16 | ############################################################################ |
| 17 | # |
| 18 | # |
| 19 | # Tests for 'fossil revert' |
| 20 | # |
| 21 | # |
| 22 | |
| 23 | # Test 'fossil revert' against expected results from 'fossil changes' and |
| 24 | # 'fossil addremove -n', as well as by verifying the existence of files |
| 25 | # on the file system. 'fossil undo' is called after each test |
| 26 |
| --- test/revert.test | |
| +++ test/revert.test | |
| @@ -15,11 +15,11 @@ | |
| 15 | # |
| 16 | ############################################################################ |
| 17 | # |
| 18 | # |
| 19 | # Tests for 'fossil revert' |
| 20 | # |
| 21 | # |
| 22 | |
| 23 | # Test 'fossil revert' against expected results from 'fossil changes' and |
| 24 | # 'fossil addremove -n', as well as by verifying the existence of files |
| 25 | # on the file system. 'fossil undo' is called after each test |
| 26 |