Fossil SCM
Merging from trunk. I manually solved the conflict widening the user name on annotate.
Commit
f201fbaea31ff3492d5e23e2e4d969fca311daec
Parent
675b49efa36ce83…
21 files changed
+1
+1
-1
+17
-9
+12
-14
+3
-3
+3
-3
+3
-6
+48
-14
-1
+1
-2
+9
-6
+5
-1
+10
-4
+23
-15
-3
-3
-3
+1
-1
+5
-1
+21
-2
+92
-98
~
ajax/index.html
~
auto.def
~
src/clone.c
~
src/cson_amalgamation.c
~
src/diff.c
~
src/diff.c
~
src/json.c
~
src/json_artifact.c
~
src/json_diff.c
~
src/json_timeline.c
~
src/json_wiki.c
~
src/makemake.tcl
~
src/merge3.c
~
src/rebuild.c
~
src/report.c
~
src/timeline.c
~
src/timeline.c
~
src/update.c
~
win/Makefile.mingw
~
win/Makefile.mingw.mistachkin
~
www/stats.wiki
+1
| --- ajax/index.html | ||
| +++ ajax/index.html | ||
| @@ -234,10 +234,11 @@ | ||
| 234 | 234 | <input type='button' value='timeline/ci' onclick='TheApp.cgi.sendCommand("/json/timeline/ci?files=true")' /> |
| 235 | 235 | <input type='button' value='timeline/wiki' onclick='TheApp.cgi.sendCommand("/json/timeline/wiki")' /> |
| 236 | 236 | <input type='button' value='timeline/ticket' onclick='TheApp.cgi.sendCommand("/json/timeline/ticket")' /> |
| 237 | 237 | <input type='button' value='timeline/branch' onclick='TheApp.cgi.sendCommand("/json/timeline/branch")' /> |
| 238 | 238 | <input type='button' value='wiki/list' onclick='TheApp.cgi.sendCommand("/json/wiki/list")' /> |
| 239 | +<input type='button' value='wiki/list verbose' onclick='TheApp.cgi.sendCommand("/json/wiki/list",{verbose:1})' /> | |
| 239 | 240 | <input type='button' value='wiki/get Fossil' onclick='TheApp.cgi.sendCommand("/json/wiki/get",{name:"Fossil"})' /> |
| 240 | 241 | <input type='button' value='wiki/get/Fossil' onclick='TheApp.cgi.sendCommand("/json/wiki/get/Fossil")' /> |
| 241 | 242 | |
| 242 | 243 | <br/> |
| 243 | 244 | |
| 244 | 245 |
| --- ajax/index.html | |
| +++ ajax/index.html | |
| @@ -234,10 +234,11 @@ | |
| 234 | <input type='button' value='timeline/ci' onclick='TheApp.cgi.sendCommand("/json/timeline/ci?files=true")' /> |
| 235 | <input type='button' value='timeline/wiki' onclick='TheApp.cgi.sendCommand("/json/timeline/wiki")' /> |
| 236 | <input type='button' value='timeline/ticket' onclick='TheApp.cgi.sendCommand("/json/timeline/ticket")' /> |
| 237 | <input type='button' value='timeline/branch' onclick='TheApp.cgi.sendCommand("/json/timeline/branch")' /> |
| 238 | <input type='button' value='wiki/list' onclick='TheApp.cgi.sendCommand("/json/wiki/list")' /> |
| 239 | <input type='button' value='wiki/get Fossil' onclick='TheApp.cgi.sendCommand("/json/wiki/get",{name:"Fossil"})' /> |
| 240 | <input type='button' value='wiki/get/Fossil' onclick='TheApp.cgi.sendCommand("/json/wiki/get/Fossil")' /> |
| 241 | |
| 242 | <br/> |
| 243 | |
| 244 |
| --- ajax/index.html | |
| +++ ajax/index.html | |
| @@ -234,10 +234,11 @@ | |
| 234 | <input type='button' value='timeline/ci' onclick='TheApp.cgi.sendCommand("/json/timeline/ci?files=true")' /> |
| 235 | <input type='button' value='timeline/wiki' onclick='TheApp.cgi.sendCommand("/json/timeline/wiki")' /> |
| 236 | <input type='button' value='timeline/ticket' onclick='TheApp.cgi.sendCommand("/json/timeline/ticket")' /> |
| 237 | <input type='button' value='timeline/branch' onclick='TheApp.cgi.sendCommand("/json/timeline/branch")' /> |
| 238 | <input type='button' value='wiki/list' onclick='TheApp.cgi.sendCommand("/json/wiki/list")' /> |
| 239 | <input type='button' value='wiki/list verbose' onclick='TheApp.cgi.sendCommand("/json/wiki/list",{verbose:1})' /> |
| 240 | <input type='button' value='wiki/get Fossil' onclick='TheApp.cgi.sendCommand("/json/wiki/get",{name:"Fossil"})' /> |
| 241 | <input type='button' value='wiki/get/Fossil' onclick='TheApp.cgi.sendCommand("/json/wiki/get/Fossil")' /> |
| 242 | |
| 243 | <br/> |
| 244 | |
| 245 |
M
auto.def
+1
-1
| --- auto.def | ||
| +++ auto.def | ||
| @@ -156,11 +156,11 @@ | ||
| 156 | 156 | set cflags "" |
| 157 | 157 | set ldflags "" |
| 158 | 158 | } else { |
| 159 | 159 | set msg "ssl in $dir" |
| 160 | 160 | set cflags "-I$dir/include" |
| 161 | - set ldflags "-L$dir/include" | |
| 161 | + set ldflags "-L$dir/lib" | |
| 162 | 162 | } |
| 163 | 163 | if {[check-for-openssl $msg "$cflags $ldflags"]} { |
| 164 | 164 | incr found |
| 165 | 165 | break |
| 166 | 166 | } |
| 167 | 167 |
| --- auto.def | |
| +++ auto.def | |
| @@ -156,11 +156,11 @@ | |
| 156 | set cflags "" |
| 157 | set ldflags "" |
| 158 | } else { |
| 159 | set msg "ssl in $dir" |
| 160 | set cflags "-I$dir/include" |
| 161 | set ldflags "-L$dir/include" |
| 162 | } |
| 163 | if {[check-for-openssl $msg "$cflags $ldflags"]} { |
| 164 | incr found |
| 165 | break |
| 166 | } |
| 167 |
| --- auto.def | |
| +++ auto.def | |
| @@ -156,11 +156,11 @@ | |
| 156 | set cflags "" |
| 157 | set ldflags "" |
| 158 | } else { |
| 159 | set msg "ssl in $dir" |
| 160 | set cflags "-I$dir/include" |
| 161 | set ldflags "-L$dir/lib" |
| 162 | } |
| 163 | if {[check-for-openssl $msg "$cflags $ldflags"]} { |
| 164 | incr found |
| 165 | break |
| 166 | } |
| 167 |
+17
-9
| --- src/clone.c | ||
| +++ src/clone.c | ||
| @@ -20,18 +20,20 @@ | ||
| 20 | 20 | #include "config.h" |
| 21 | 21 | #include "clone.h" |
| 22 | 22 | #include <assert.h> |
| 23 | 23 | |
| 24 | 24 | /* |
| 25 | -** Delete all private content from a repository. | |
| 25 | +** If there are public BLOBs that deltas from private BLOBs, then | |
| 26 | +** undeltify the public BLOBs so that the private BLOBs may be safely | |
| 27 | +** deleted. | |
| 26 | 28 | */ |
| 27 | -void delete_private_content(void){ | |
| 29 | +void fix_private_blob_dependencies(int showWarning){ | |
| 28 | 30 | Bag toUndelta; |
| 29 | 31 | Stmt q; |
| 30 | 32 | int rid; |
| 31 | 33 | |
| 32 | - /* Carefule: We are about to delete all BLOB entries that are private. | |
| 34 | + /* Careful: We are about to delete all BLOB entries that are private. | |
| 33 | 35 | ** So make sure that any no public BLOBs are deltas from a private BLOB. |
| 34 | 36 | ** Otherwise after the deletion, we won't be able to recreate the public |
| 35 | 37 | ** BLOBs. |
| 36 | 38 | */ |
| 37 | 39 | db_prepare(&q, |
| @@ -45,25 +47,31 @@ | ||
| 45 | 47 | while( db_step(&q)==SQLITE_ROW ){ |
| 46 | 48 | int rid = db_column_int(&q, 0); |
| 47 | 49 | const char *zId = db_column_text(&q, 1); |
| 48 | 50 | int srcid = db_column_int(&q, 2); |
| 49 | 51 | const char *zSrc = db_column_text(&q, 3); |
| 50 | - fossil_warning( | |
| 51 | - "public artifact %S (%d) is a delta from private artifact %S (%d)\n", | |
| 52 | - zId, rid, zSrc, srcid | |
| 53 | - ); | |
| 52 | + if( showWarning ){ | |
| 53 | + fossil_warning( | |
| 54 | + "public artifact %S (%d) is a delta from private artifact %S (%d)", | |
| 55 | + zId, rid, zSrc, srcid | |
| 56 | + ); | |
| 57 | + } | |
| 54 | 58 | bag_insert(&toUndelta, rid); |
| 55 | 59 | } |
| 56 | 60 | db_finalize(&q); |
| 57 | 61 | while( (rid = bag_first(&toUndelta))>0 ){ |
| 58 | 62 | content_undelta(rid); |
| 59 | 63 | bag_remove(&toUndelta, rid); |
| 60 | 64 | } |
| 61 | 65 | bag_clear(&toUndelta); |
| 66 | +} | |
| 62 | 67 | |
| 63 | - /* Now it is safe to remove all private content | |
| 64 | - */ | |
| 68 | +/* | |
| 69 | +** Delete all private content from a repository. | |
| 70 | +*/ | |
| 71 | +void delete_private_content(void){ | |
| 72 | + fix_private_blob_dependencies(1); | |
| 65 | 73 | db_multi_exec( |
| 66 | 74 | "DELETE FROM blob WHERE rid IN private;" |
| 67 | 75 | "DELETE FROM delta wHERE rid IN private;" |
| 68 | 76 | "DELETE FROM private;" |
| 69 | 77 | ); |
| 70 | 78 |
| --- src/clone.c | |
| +++ src/clone.c | |
| @@ -20,18 +20,20 @@ | |
| 20 | #include "config.h" |
| 21 | #include "clone.h" |
| 22 | #include <assert.h> |
| 23 | |
| 24 | /* |
| 25 | ** Delete all private content from a repository. |
| 26 | */ |
| 27 | void delete_private_content(void){ |
| 28 | Bag toUndelta; |
| 29 | Stmt q; |
| 30 | int rid; |
| 31 | |
| 32 | /* Carefule: We are about to delete all BLOB entries that are private. |
| 33 | ** So make sure that any no public BLOBs are deltas from a private BLOB. |
| 34 | ** Otherwise after the deletion, we won't be able to recreate the public |
| 35 | ** BLOBs. |
| 36 | */ |
| 37 | db_prepare(&q, |
| @@ -45,25 +47,31 @@ | |
| 45 | while( db_step(&q)==SQLITE_ROW ){ |
| 46 | int rid = db_column_int(&q, 0); |
| 47 | const char *zId = db_column_text(&q, 1); |
| 48 | int srcid = db_column_int(&q, 2); |
| 49 | const char *zSrc = db_column_text(&q, 3); |
| 50 | fossil_warning( |
| 51 | "public artifact %S (%d) is a delta from private artifact %S (%d)\n", |
| 52 | zId, rid, zSrc, srcid |
| 53 | ); |
| 54 | bag_insert(&toUndelta, rid); |
| 55 | } |
| 56 | db_finalize(&q); |
| 57 | while( (rid = bag_first(&toUndelta))>0 ){ |
| 58 | content_undelta(rid); |
| 59 | bag_remove(&toUndelta, rid); |
| 60 | } |
| 61 | bag_clear(&toUndelta); |
| 62 | |
| 63 | /* Now it is safe to remove all private content |
| 64 | */ |
| 65 | db_multi_exec( |
| 66 | "DELETE FROM blob WHERE rid IN private;" |
| 67 | "DELETE FROM delta wHERE rid IN private;" |
| 68 | "DELETE FROM private;" |
| 69 | ); |
| 70 |
| --- src/clone.c | |
| +++ src/clone.c | |
| @@ -20,18 +20,20 @@ | |
| 20 | #include "config.h" |
| 21 | #include "clone.h" |
| 22 | #include <assert.h> |
| 23 | |
| 24 | /* |
| 25 | ** If there are public BLOBs that deltas from private BLOBs, then |
| 26 | ** undeltify the public BLOBs so that the private BLOBs may be safely |
| 27 | ** deleted. |
| 28 | */ |
| 29 | void fix_private_blob_dependencies(int showWarning){ |
| 30 | Bag toUndelta; |
| 31 | Stmt q; |
| 32 | int rid; |
| 33 | |
| 34 | /* Careful: We are about to delete all BLOB entries that are private. |
| 35 | ** So make sure that any no public BLOBs are deltas from a private BLOB. |
| 36 | ** Otherwise after the deletion, we won't be able to recreate the public |
| 37 | ** BLOBs. |
| 38 | */ |
| 39 | db_prepare(&q, |
| @@ -45,25 +47,31 @@ | |
| 47 | while( db_step(&q)==SQLITE_ROW ){ |
| 48 | int rid = db_column_int(&q, 0); |
| 49 | const char *zId = db_column_text(&q, 1); |
| 50 | int srcid = db_column_int(&q, 2); |
| 51 | const char *zSrc = db_column_text(&q, 3); |
| 52 | if( showWarning ){ |
| 53 | fossil_warning( |
| 54 | "public artifact %S (%d) is a delta from private artifact %S (%d)", |
| 55 | zId, rid, zSrc, srcid |
| 56 | ); |
| 57 | } |
| 58 | bag_insert(&toUndelta, rid); |
| 59 | } |
| 60 | db_finalize(&q); |
| 61 | while( (rid = bag_first(&toUndelta))>0 ){ |
| 62 | content_undelta(rid); |
| 63 | bag_remove(&toUndelta, rid); |
| 64 | } |
| 65 | bag_clear(&toUndelta); |
| 66 | } |
| 67 | |
| 68 | /* |
| 69 | ** Delete all private content from a repository. |
| 70 | */ |
| 71 | void delete_private_content(void){ |
| 72 | fix_private_blob_dependencies(1); |
| 73 | db_multi_exec( |
| 74 | "DELETE FROM blob WHERE rid IN private;" |
| 75 | "DELETE FROM delta wHERE rid IN private;" |
| 76 | "DELETE FROM private;" |
| 77 | ); |
| 78 |
+12
-14
| --- src/cson_amalgamation.c | ||
| +++ src/cson_amalgamation.c | ||
| @@ -2200,14 +2200,13 @@ | ||
| 2200 | 2200 | # define VALUE_T_IS_PTR 1 |
| 2201 | 2201 | #else |
| 2202 | 2202 | #endif |
| 2203 | 2203 | |
| 2204 | 2204 | /** |
| 2205 | - Allocates a new value of the specified type ownership of it to the | |
| 2206 | - caller. It must eventually be destroyed, by the caller or its | |
| 2207 | - owning container, by passing it to cson_value_free() or transfering | |
| 2208 | - ownership to a container. | |
| 2205 | + Allocates a new value of the specified type. Ownership is | |
| 2206 | + transfered to the caller, who must eventually free it by passing it | |
| 2207 | + to cson_value_free() or transfering ownership to a container. | |
| 2209 | 2208 | |
| 2210 | 2209 | extra is only valid for type CSON_TYPE_STRING, and must be the length |
| 2211 | 2210 | of the string to allocate + 1 byte (for the NUL). |
| 2212 | 2211 | |
| 2213 | 2212 | The returned value->api member will be set appropriately and |
| @@ -2249,10 +2248,15 @@ | ||
| 2249 | 2248 | tx = sizeof(cson_double_t); |
| 2250 | 2249 | reason = "cson_value:double"; |
| 2251 | 2250 | break; |
| 2252 | 2251 | case CSON_TYPE_INTEGER: |
| 2253 | 2252 | assert( 0 == extra ); |
| 2253 | + /* FIXME: if sizeof(void*) >= sizeof(cson_int_t) then store | |
| 2254 | + the int value directly in the void pointer (requires no | |
| 2255 | + extra alloc). The current behaviour requires 32 | |
| 2256 | + bytes(!!!) on 64-bit builds. | |
| 2257 | + */ | |
| 2254 | 2258 | def = cson_value_integer_empty; |
| 2255 | 2259 | tx = sizeof(cson_int_t); |
| 2256 | 2260 | reason = "cson_value:int"; |
| 2257 | 2261 | break; |
| 2258 | 2262 | case CSON_TYPE_STRING: |
| @@ -2281,11 +2285,10 @@ | ||
| 2281 | 2285 | } |
| 2282 | 2286 | } |
| 2283 | 2287 | return v; |
| 2284 | 2288 | } |
| 2285 | 2289 | |
| 2286 | - | |
| 2287 | 2290 | void cson_value_free(cson_value *v) |
| 2288 | 2291 | { |
| 2289 | 2292 | cson_refcount_decr( v ); |
| 2290 | 2293 | } |
| 2291 | 2294 | |
| @@ -2304,15 +2307,10 @@ | ||
| 2304 | 2307 | } |
| 2305 | 2308 | #endif |
| 2306 | 2309 | |
| 2307 | 2310 | char cson_value_is_undef( cson_value const * v ) |
| 2308 | 2311 | { |
| 2309 | - /** | |
| 2310 | - This special-case impl is needed because the underlying | |
| 2311 | - (generic) list operations do not know how to populate | |
| 2312 | - new entries | |
| 2313 | - */ | |
| 2314 | 2312 | return ( !v || !v->api || (v->api==&cson_value_api_undef)) |
| 2315 | 2313 | ? 1 : 0; |
| 2316 | 2314 | } |
| 2317 | 2315 | #define ISA(T,TID) char cson_value_is_##T( cson_value const * v ) { \ |
| 2318 | 2316 | /*return (v && v->api) ? cson_value_is_a(v,CSON_TYPE_##TID) : 0;*/ \ |
| @@ -3733,12 +3731,14 @@ | ||
| 3733 | 3731 | *pzNext = z; |
| 3734 | 3732 | return c; |
| 3735 | 3733 | } |
| 3736 | 3734 | #undef READ_UTF8 |
| 3737 | 3735 | |
| 3738 | -#if defined(_WIN32) | |
| 3739 | -# pragma warning( pop ) | |
| 3736 | +#ifdef _MSC_VER | |
| 3737 | +# if _MSC_VER >= 1400 /* Visual Studio 2005 and up */ | |
| 3738 | +# pragma warning( pop ) | |
| 3739 | +# endif | |
| 3740 | 3740 | #endif |
| 3741 | 3741 | |
| 3742 | 3742 | unsigned int cson_string_length_utf8( cson_string const * str ) |
| 3743 | 3743 | { |
| 3744 | 3744 | if( ! str ) return 0; |
| @@ -5504,11 +5504,10 @@ | ||
| 5504 | 5504 | else |
| 5505 | 5505 | { |
| 5506 | 5506 | cson_value * rootV = NULL; |
| 5507 | 5507 | cson_object * root = NULL; |
| 5508 | 5508 | cson_value * aryV = NULL; |
| 5509 | - cson_array * ary = NULL; | |
| 5510 | 5509 | cson_value * rowsV = NULL; |
| 5511 | 5510 | cson_array * rows = NULL; |
| 5512 | 5511 | int rc = 0; |
| 5513 | 5512 | int const colCount = sqlite3_column_count(st); |
| 5514 | 5513 | if( colCount <= 0 ) return cson_rc.ArgError; |
| @@ -5526,11 +5525,10 @@ | ||
| 5526 | 5525 | { |
| 5527 | 5526 | cson_value_free( aryV ); |
| 5528 | 5527 | RETURN(rc); |
| 5529 | 5528 | } |
| 5530 | 5529 | aryV = NULL; |
| 5531 | - ary = NULL; | |
| 5532 | 5530 | rowsV = cson_value_new_array(); |
| 5533 | 5531 | if( ! rowsV ) RETURN(cson_rc.AllocError); |
| 5534 | 5532 | rc = cson_object_set( root, "rows", rowsV ); |
| 5535 | 5533 | if( 0 != rc ) |
| 5536 | 5534 | { |
| 5537 | 5535 |
| --- src/cson_amalgamation.c | |
| +++ src/cson_amalgamation.c | |
| @@ -2200,14 +2200,13 @@ | |
| 2200 | # define VALUE_T_IS_PTR 1 |
| 2201 | #else |
| 2202 | #endif |
| 2203 | |
| 2204 | /** |
| 2205 | Allocates a new value of the specified type ownership of it to the |
| 2206 | caller. It must eventually be destroyed, by the caller or its |
| 2207 | owning container, by passing it to cson_value_free() or transfering |
| 2208 | ownership to a container. |
| 2209 | |
| 2210 | extra is only valid for type CSON_TYPE_STRING, and must be the length |
| 2211 | of the string to allocate + 1 byte (for the NUL). |
| 2212 | |
| 2213 | The returned value->api member will be set appropriately and |
| @@ -2249,10 +2248,15 @@ | |
| 2249 | tx = sizeof(cson_double_t); |
| 2250 | reason = "cson_value:double"; |
| 2251 | break; |
| 2252 | case CSON_TYPE_INTEGER: |
| 2253 | assert( 0 == extra ); |
| 2254 | def = cson_value_integer_empty; |
| 2255 | tx = sizeof(cson_int_t); |
| 2256 | reason = "cson_value:int"; |
| 2257 | break; |
| 2258 | case CSON_TYPE_STRING: |
| @@ -2281,11 +2285,10 @@ | |
| 2281 | } |
| 2282 | } |
| 2283 | return v; |
| 2284 | } |
| 2285 | |
| 2286 | |
| 2287 | void cson_value_free(cson_value *v) |
| 2288 | { |
| 2289 | cson_refcount_decr( v ); |
| 2290 | } |
| 2291 | |
| @@ -2304,15 +2307,10 @@ | |
| 2304 | } |
| 2305 | #endif |
| 2306 | |
| 2307 | char cson_value_is_undef( cson_value const * v ) |
| 2308 | { |
| 2309 | /** |
| 2310 | This special-case impl is needed because the underlying |
| 2311 | (generic) list operations do not know how to populate |
| 2312 | new entries |
| 2313 | */ |
| 2314 | return ( !v || !v->api || (v->api==&cson_value_api_undef)) |
| 2315 | ? 1 : 0; |
| 2316 | } |
| 2317 | #define ISA(T,TID) char cson_value_is_##T( cson_value const * v ) { \ |
| 2318 | /*return (v && v->api) ? cson_value_is_a(v,CSON_TYPE_##TID) : 0;*/ \ |
| @@ -3733,12 +3731,14 @@ | |
| 3733 | *pzNext = z; |
| 3734 | return c; |
| 3735 | } |
| 3736 | #undef READ_UTF8 |
| 3737 | |
| 3738 | #if defined(_WIN32) |
| 3739 | # pragma warning( pop ) |
| 3740 | #endif |
| 3741 | |
| 3742 | unsigned int cson_string_length_utf8( cson_string const * str ) |
| 3743 | { |
| 3744 | if( ! str ) return 0; |
| @@ -5504,11 +5504,10 @@ | |
| 5504 | else |
| 5505 | { |
| 5506 | cson_value * rootV = NULL; |
| 5507 | cson_object * root = NULL; |
| 5508 | cson_value * aryV = NULL; |
| 5509 | cson_array * ary = NULL; |
| 5510 | cson_value * rowsV = NULL; |
| 5511 | cson_array * rows = NULL; |
| 5512 | int rc = 0; |
| 5513 | int const colCount = sqlite3_column_count(st); |
| 5514 | if( colCount <= 0 ) return cson_rc.ArgError; |
| @@ -5526,11 +5525,10 @@ | |
| 5526 | { |
| 5527 | cson_value_free( aryV ); |
| 5528 | RETURN(rc); |
| 5529 | } |
| 5530 | aryV = NULL; |
| 5531 | ary = NULL; |
| 5532 | rowsV = cson_value_new_array(); |
| 5533 | if( ! rowsV ) RETURN(cson_rc.AllocError); |
| 5534 | rc = cson_object_set( root, "rows", rowsV ); |
| 5535 | if( 0 != rc ) |
| 5536 | { |
| 5537 |
| --- src/cson_amalgamation.c | |
| +++ src/cson_amalgamation.c | |
| @@ -2200,14 +2200,13 @@ | |
| 2200 | # define VALUE_T_IS_PTR 1 |
| 2201 | #else |
| 2202 | #endif |
| 2203 | |
| 2204 | /** |
| 2205 | Allocates a new value of the specified type. Ownership is |
| 2206 | transfered to the caller, who must eventually free it by passing it |
| 2207 | to cson_value_free() or transfering ownership to a container. |
| 2208 | |
| 2209 | extra is only valid for type CSON_TYPE_STRING, and must be the length |
| 2210 | of the string to allocate + 1 byte (for the NUL). |
| 2211 | |
| 2212 | The returned value->api member will be set appropriately and |
| @@ -2249,10 +2248,15 @@ | |
| 2248 | tx = sizeof(cson_double_t); |
| 2249 | reason = "cson_value:double"; |
| 2250 | break; |
| 2251 | case CSON_TYPE_INTEGER: |
| 2252 | assert( 0 == extra ); |
| 2253 | /* FIXME: if sizeof(void*) >= sizeof(cson_int_t) then store |
| 2254 | the int value directly in the void pointer (requires no |
| 2255 | extra alloc). The current behaviour requires 32 |
| 2256 | bytes(!!!) on 64-bit builds. |
| 2257 | */ |
| 2258 | def = cson_value_integer_empty; |
| 2259 | tx = sizeof(cson_int_t); |
| 2260 | reason = "cson_value:int"; |
| 2261 | break; |
| 2262 | case CSON_TYPE_STRING: |
| @@ -2281,11 +2285,10 @@ | |
| 2285 | } |
| 2286 | } |
| 2287 | return v; |
| 2288 | } |
| 2289 | |
| 2290 | void cson_value_free(cson_value *v) |
| 2291 | { |
| 2292 | cson_refcount_decr( v ); |
| 2293 | } |
| 2294 | |
| @@ -2304,15 +2307,10 @@ | |
| 2307 | } |
| 2308 | #endif |
| 2309 | |
| 2310 | char cson_value_is_undef( cson_value const * v ) |
| 2311 | { |
| 2312 | return ( !v || !v->api || (v->api==&cson_value_api_undef)) |
| 2313 | ? 1 : 0; |
| 2314 | } |
| 2315 | #define ISA(T,TID) char cson_value_is_##T( cson_value const * v ) { \ |
| 2316 | /*return (v && v->api) ? cson_value_is_a(v,CSON_TYPE_##TID) : 0;*/ \ |
| @@ -3733,12 +3731,14 @@ | |
| 3731 | *pzNext = z; |
| 3732 | return c; |
| 3733 | } |
| 3734 | #undef READ_UTF8 |
| 3735 | |
| 3736 | #ifdef _MSC_VER |
| 3737 | # if _MSC_VER >= 1400 /* Visual Studio 2005 and up */ |
| 3738 | # pragma warning( pop ) |
| 3739 | # endif |
| 3740 | #endif |
| 3741 | |
| 3742 | unsigned int cson_string_length_utf8( cson_string const * str ) |
| 3743 | { |
| 3744 | if( ! str ) return 0; |
| @@ -5504,11 +5504,10 @@ | |
| 5504 | else |
| 5505 | { |
| 5506 | cson_value * rootV = NULL; |
| 5507 | cson_object * root = NULL; |
| 5508 | cson_value * aryV = NULL; |
| 5509 | cson_value * rowsV = NULL; |
| 5510 | cson_array * rows = NULL; |
| 5511 | int rc = 0; |
| 5512 | int const colCount = sqlite3_column_count(st); |
| 5513 | if( colCount <= 0 ) return cson_rc.ArgError; |
| @@ -5526,11 +5525,10 @@ | |
| 5525 | { |
| 5526 | cson_value_free( aryV ); |
| 5527 | RETURN(rc); |
| 5528 | } |
| 5529 | aryV = NULL; |
| 5530 | rowsV = cson_value_new_array(); |
| 5531 | if( ! rowsV ) RETURN(cson_rc.AllocError); |
| 5532 | rc = cson_object_set( root, "rows", rowsV ); |
| 5533 | if( 0 != rc ) |
| 5534 | { |
| 5535 |
+3
-3
| --- src/diff.c | ||
| +++ src/diff.c | ||
| @@ -1788,23 +1788,23 @@ | ||
| 1788 | 1788 | if( webLabel ){ |
| 1789 | 1789 | if (zUuidParentFile) { |
| 1790 | 1790 | zLabel = mprintf( |
| 1791 | 1791 | "<a href='%s/info/%s' %s>%.10s</a> " |
| 1792 | 1792 | "<a href='%s/fdiff?v1=%s&v2=%s' %s>d</a> " |
| 1793 | - "%s %9.9s", | |
| 1793 | + "%s %13.13s", | |
| 1794 | 1794 | g.zTop, zUuid, zInfoTarget, zUuid, |
| 1795 | 1795 | g.zTop, zUuidParentFile, zUuidFile, zDiffTarget, |
| 1796 | 1796 | zDate, zUser); |
| 1797 | 1797 | }else{ |
| 1798 | 1798 | zLabel = mprintf( |
| 1799 | 1799 | "<a href='%s/info/%s' %s>%.10s</a> " |
| 1800 | - "%s %9.9s", | |
| 1800 | + "%s %13.13s", | |
| 1801 | 1801 | g.zTop, zUuid, zInfoTarget, zUuid, |
| 1802 | 1802 | zDate, zUser); |
| 1803 | 1803 | } |
| 1804 | 1804 | }else{ |
| 1805 | - zLabel = mprintf("%.10s %s %9.9s", zUuid, zDate, zUser); | |
| 1805 | + zLabel = mprintf("%.10s %s %13.13s", zUuid, zDate, zUser); | |
| 1806 | 1806 | } |
| 1807 | 1807 | p->nVers++; |
| 1808 | 1808 | p->azVers = fossil_realloc(p->azVers, p->nVers*sizeof(p->azVers[0]) ); |
| 1809 | 1809 | p->azVers[p->nVers-1] = zLabel; |
| 1810 | 1810 | content_get(pid, &step); |
| 1811 | 1811 |
| --- src/diff.c | |
| +++ src/diff.c | |
| @@ -1788,23 +1788,23 @@ | |
| 1788 | if( webLabel ){ |
| 1789 | if (zUuidParentFile) { |
| 1790 | zLabel = mprintf( |
| 1791 | "<a href='%s/info/%s' %s>%.10s</a> " |
| 1792 | "<a href='%s/fdiff?v1=%s&v2=%s' %s>d</a> " |
| 1793 | "%s %9.9s", |
| 1794 | g.zTop, zUuid, zInfoTarget, zUuid, |
| 1795 | g.zTop, zUuidParentFile, zUuidFile, zDiffTarget, |
| 1796 | zDate, zUser); |
| 1797 | }else{ |
| 1798 | zLabel = mprintf( |
| 1799 | "<a href='%s/info/%s' %s>%.10s</a> " |
| 1800 | "%s %9.9s", |
| 1801 | g.zTop, zUuid, zInfoTarget, zUuid, |
| 1802 | zDate, zUser); |
| 1803 | } |
| 1804 | }else{ |
| 1805 | zLabel = mprintf("%.10s %s %9.9s", zUuid, zDate, zUser); |
| 1806 | } |
| 1807 | p->nVers++; |
| 1808 | p->azVers = fossil_realloc(p->azVers, p->nVers*sizeof(p->azVers[0]) ); |
| 1809 | p->azVers[p->nVers-1] = zLabel; |
| 1810 | content_get(pid, &step); |
| 1811 |
| --- src/diff.c | |
| +++ src/diff.c | |
| @@ -1788,23 +1788,23 @@ | |
| 1788 | if( webLabel ){ |
| 1789 | if (zUuidParentFile) { |
| 1790 | zLabel = mprintf( |
| 1791 | "<a href='%s/info/%s' %s>%.10s</a> " |
| 1792 | "<a href='%s/fdiff?v1=%s&v2=%s' %s>d</a> " |
| 1793 | "%s %13.13s", |
| 1794 | g.zTop, zUuid, zInfoTarget, zUuid, |
| 1795 | g.zTop, zUuidParentFile, zUuidFile, zDiffTarget, |
| 1796 | zDate, zUser); |
| 1797 | }else{ |
| 1798 | zLabel = mprintf( |
| 1799 | "<a href='%s/info/%s' %s>%.10s</a> " |
| 1800 | "%s %13.13s", |
| 1801 | g.zTop, zUuid, zInfoTarget, zUuid, |
| 1802 | zDate, zUser); |
| 1803 | } |
| 1804 | }else{ |
| 1805 | zLabel = mprintf("%.10s %s %13.13s", zUuid, zDate, zUser); |
| 1806 | } |
| 1807 | p->nVers++; |
| 1808 | p->azVers = fossil_realloc(p->azVers, p->nVers*sizeof(p->azVers[0]) ); |
| 1809 | p->azVers[p->nVers-1] = zLabel; |
| 1810 | content_get(pid, &step); |
| 1811 |
+3
-3
| --- src/diff.c | ||
| +++ src/diff.c | ||
| @@ -1788,23 +1788,23 @@ | ||
| 1788 | 1788 | if( webLabel ){ |
| 1789 | 1789 | if (zUuidParentFile) { |
| 1790 | 1790 | zLabel = mprintf( |
| 1791 | 1791 | "<a href='%s/info/%s' %s>%.10s</a> " |
| 1792 | 1792 | "<a href='%s/fdiff?v1=%s&v2=%s' %s>d</a> " |
| 1793 | - "%s %9.9s", | |
| 1793 | + "%s %13.13s", | |
| 1794 | 1794 | g.zTop, zUuid, zInfoTarget, zUuid, |
| 1795 | 1795 | g.zTop, zUuidParentFile, zUuidFile, zDiffTarget, |
| 1796 | 1796 | zDate, zUser); |
| 1797 | 1797 | }else{ |
| 1798 | 1798 | zLabel = mprintf( |
| 1799 | 1799 | "<a href='%s/info/%s' %s>%.10s</a> " |
| 1800 | - "%s %9.9s", | |
| 1800 | + "%s %13.13s", | |
| 1801 | 1801 | g.zTop, zUuid, zInfoTarget, zUuid, |
| 1802 | 1802 | zDate, zUser); |
| 1803 | 1803 | } |
| 1804 | 1804 | }else{ |
| 1805 | - zLabel = mprintf("%.10s %s %9.9s", zUuid, zDate, zUser); | |
| 1805 | + zLabel = mprintf("%.10s %s %13.13s", zUuid, zDate, zUser); | |
| 1806 | 1806 | } |
| 1807 | 1807 | p->nVers++; |
| 1808 | 1808 | p->azVers = fossil_realloc(p->azVers, p->nVers*sizeof(p->azVers[0]) ); |
| 1809 | 1809 | p->azVers[p->nVers-1] = zLabel; |
| 1810 | 1810 | content_get(pid, &step); |
| 1811 | 1811 |
| --- src/diff.c | |
| +++ src/diff.c | |
| @@ -1788,23 +1788,23 @@ | |
| 1788 | if( webLabel ){ |
| 1789 | if (zUuidParentFile) { |
| 1790 | zLabel = mprintf( |
| 1791 | "<a href='%s/info/%s' %s>%.10s</a> " |
| 1792 | "<a href='%s/fdiff?v1=%s&v2=%s' %s>d</a> " |
| 1793 | "%s %9.9s", |
| 1794 | g.zTop, zUuid, zInfoTarget, zUuid, |
| 1795 | g.zTop, zUuidParentFile, zUuidFile, zDiffTarget, |
| 1796 | zDate, zUser); |
| 1797 | }else{ |
| 1798 | zLabel = mprintf( |
| 1799 | "<a href='%s/info/%s' %s>%.10s</a> " |
| 1800 | "%s %9.9s", |
| 1801 | g.zTop, zUuid, zInfoTarget, zUuid, |
| 1802 | zDate, zUser); |
| 1803 | } |
| 1804 | }else{ |
| 1805 | zLabel = mprintf("%.10s %s %9.9s", zUuid, zDate, zUser); |
| 1806 | } |
| 1807 | p->nVers++; |
| 1808 | p->azVers = fossil_realloc(p->azVers, p->nVers*sizeof(p->azVers[0]) ); |
| 1809 | p->azVers[p->nVers-1] = zLabel; |
| 1810 | content_get(pid, &step); |
| 1811 |
| --- src/diff.c | |
| +++ src/diff.c | |
| @@ -1788,23 +1788,23 @@ | |
| 1788 | if( webLabel ){ |
| 1789 | if (zUuidParentFile) { |
| 1790 | zLabel = mprintf( |
| 1791 | "<a href='%s/info/%s' %s>%.10s</a> " |
| 1792 | "<a href='%s/fdiff?v1=%s&v2=%s' %s>d</a> " |
| 1793 | "%s %13.13s", |
| 1794 | g.zTop, zUuid, zInfoTarget, zUuid, |
| 1795 | g.zTop, zUuidParentFile, zUuidFile, zDiffTarget, |
| 1796 | zDate, zUser); |
| 1797 | }else{ |
| 1798 | zLabel = mprintf( |
| 1799 | "<a href='%s/info/%s' %s>%.10s</a> " |
| 1800 | "%s %13.13s", |
| 1801 | g.zTop, zUuid, zInfoTarget, zUuid, |
| 1802 | zDate, zUser); |
| 1803 | } |
| 1804 | }else{ |
| 1805 | zLabel = mprintf("%.10s %s %13.13s", zUuid, zDate, zUser); |
| 1806 | } |
| 1807 | p->nVers++; |
| 1808 | p->azVers = fossil_realloc(p->azVers, p->nVers*sizeof(p->azVers[0]) ); |
| 1809 | p->azVers[p->nVers-1] = zLabel; |
| 1810 | content_get(pid, &step); |
| 1811 |
+3
-6
| --- src/json.c | ||
| +++ src/json.c | ||
| @@ -84,17 +84,17 @@ | ||
| 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 |
| @@ -162,10 +162,11 @@ | ||
| 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() |
| @@ -912,11 +913,10 @@ | ||
| 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; |
| @@ -1015,11 +1015,10 @@ | ||
| 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; |
| @@ -1151,11 +1150,10 @@ | ||
| 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 |
| @@ -1331,11 +1329,10 @@ | ||
| 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 |
| --- src/json.c | |
| +++ src/json.c | |
| @@ -84,17 +84,17 @@ | |
| 84 | ** Print the timing results. |
| 85 | */ |
| 86 | static double endTimer(void){ |
| 87 | struct rusage sEnd; |
| 88 | getrusage(RUSAGE_SELF, &sEnd); |
| 89 | return timeDiff(&sBegin.ru_utime, &sEnd.ru_utime) |
| 90 | + timeDiff(&sBegin.ru_stime, &sEnd.ru_stime); |
| 91 | #if 0 |
| 92 | printf("CPU Time: user %f sys %f\n", |
| 93 | timeDiff(&sBegin.ru_utime, &sEnd.ru_utime), |
| 94 | timeDiff(&sBegin.ru_stime, &sEnd.ru_stime)); |
| 95 | #endif |
| 96 | } |
| 97 | |
| 98 | #define BEGIN_TIMER beginTimer() |
| 99 | #define END_TIMER endTimer() |
| 100 | #define HAS_TIMER 1 |
| @@ -162,10 +162,11 @@ | |
| 162 | FILETIME ftCreation, ftExit, ftKernelEnd, ftUserEnd; |
| 163 | getProcessTimesAddr(hProcess, &ftCreation, &ftExit, &ftKernelEnd, &ftUserEnd); |
| 164 | return timeDiff(&ftUserBegin, &ftUserEnd) + |
| 165 | timeDiff(&ftKernelBegin, &ftKernelEnd); |
| 166 | } |
| 167 | } |
| 168 | |
| 169 | #define BEGIN_TIMER beginTimer() |
| 170 | #define END_TIMER endTimer() |
| 171 | #define HAS_TIMER hasTimer() |
| @@ -912,11 +913,10 @@ | |
| 912 | cson_array * target ){ |
| 913 | char const * p = zStr /* current byte */; |
| 914 | char const * head /* current start-of-token */; |
| 915 | unsigned int len = 0 /* current token's length */; |
| 916 | int rc = 0 /* return code (number of added elements)*/; |
| 917 | char skipWs = fossil_isspace(separator) ? 0 : 1; |
| 918 | assert( zStr && target ); |
| 919 | while( fossil_isspace(*p) ){ |
| 920 | ++p; |
| 921 | } |
| 922 | head = p; |
| @@ -1015,11 +1015,10 @@ | |
| 1015 | ** This must only be called once, or an assertion may be triggered. |
| 1016 | */ |
| 1017 | static void json_mode_bootstrap(){ |
| 1018 | static char once = 0 /* guard against multiple runs */; |
| 1019 | char const * zPath = P("PATH_INFO"); |
| 1020 | cson_value * pathSplit = NULL; |
| 1021 | assert( (0==once) && "json_mode_bootstrap() called too many times!"); |
| 1022 | if( once ){ |
| 1023 | return; |
| 1024 | }else{ |
| 1025 | once = 1; |
| @@ -1151,11 +1150,10 @@ | |
| 1151 | g.json.errorDetailParanoia = 0 /*disable error code dumb-down for CLI mode*/; |
| 1152 | } |
| 1153 | |
| 1154 | {/* set up JSON output formatting options. */ |
| 1155 | int indent = -1; |
| 1156 | char const * indentStr = NULL; |
| 1157 | indent = json_find_option_int("indent",NULL,"I",-1); |
| 1158 | g.json.outOpt.indentation = (0>indent) |
| 1159 | ? (g.isHTTP ? 0 : 1) |
| 1160 | : (unsigned char)indent; |
| 1161 | g.json.outOpt.addNewline = g.isHTTP |
| @@ -1331,11 +1329,10 @@ | |
| 1331 | if(!g.json.cmd.a){ |
| 1332 | return NULL; |
| 1333 | }else{ |
| 1334 | cson_value * rc = NULL; |
| 1335 | Blob path = empty_blob; |
| 1336 | char const * part; |
| 1337 | unsigned int aLen = g.json.dispatchDepth+1; /*cson_array_length_get(g.json.cmd.a);*/ |
| 1338 | unsigned int i = 1; |
| 1339 | for( ; i < aLen; ++i ){ |
| 1340 | char const * part = cson_string_cstr(cson_value_get_string(cson_array_get(g.json.cmd.a, i))); |
| 1341 | if(!part){ |
| 1342 |
| --- src/json.c | |
| +++ src/json.c | |
| @@ -84,17 +84,17 @@ | |
| 84 | ** Print the timing results. |
| 85 | */ |
| 86 | static double endTimer(void){ |
| 87 | struct rusage sEnd; |
| 88 | getrusage(RUSAGE_SELF, &sEnd); |
| 89 | #if 0 |
| 90 | printf("CPU Time: user %f sys %f\n", |
| 91 | timeDiff(&sBegin.ru_utime, &sEnd.ru_utime), |
| 92 | timeDiff(&sBegin.ru_stime, &sEnd.ru_stime)); |
| 93 | #endif |
| 94 | return timeDiff(&sBegin.ru_utime, &sEnd.ru_utime) |
| 95 | + timeDiff(&sBegin.ru_stime, &sEnd.ru_stime); |
| 96 | } |
| 97 | |
| 98 | #define BEGIN_TIMER beginTimer() |
| 99 | #define END_TIMER endTimer() |
| 100 | #define HAS_TIMER 1 |
| @@ -162,10 +162,11 @@ | |
| 162 | FILETIME ftCreation, ftExit, ftKernelEnd, ftUserEnd; |
| 163 | getProcessTimesAddr(hProcess, &ftCreation, &ftExit, &ftKernelEnd, &ftUserEnd); |
| 164 | return timeDiff(&ftUserBegin, &ftUserEnd) + |
| 165 | timeDiff(&ftKernelBegin, &ftKernelEnd); |
| 166 | } |
| 167 | return 0.0; |
| 168 | } |
| 169 | |
| 170 | #define BEGIN_TIMER beginTimer() |
| 171 | #define END_TIMER endTimer() |
| 172 | #define HAS_TIMER hasTimer() |
| @@ -912,11 +913,10 @@ | |
| 913 | cson_array * target ){ |
| 914 | char const * p = zStr /* current byte */; |
| 915 | char const * head /* current start-of-token */; |
| 916 | unsigned int len = 0 /* current token's length */; |
| 917 | int rc = 0 /* return code (number of added elements)*/; |
| 918 | assert( zStr && target ); |
| 919 | while( fossil_isspace(*p) ){ |
| 920 | ++p; |
| 921 | } |
| 922 | head = p; |
| @@ -1015,11 +1015,10 @@ | |
| 1015 | ** This must only be called once, or an assertion may be triggered. |
| 1016 | */ |
| 1017 | static void json_mode_bootstrap(){ |
| 1018 | static char once = 0 /* guard against multiple runs */; |
| 1019 | char const * zPath = P("PATH_INFO"); |
| 1020 | assert( (0==once) && "json_mode_bootstrap() called too many times!"); |
| 1021 | if( once ){ |
| 1022 | return; |
| 1023 | }else{ |
| 1024 | once = 1; |
| @@ -1151,11 +1150,10 @@ | |
| 1150 | g.json.errorDetailParanoia = 0 /*disable error code dumb-down for CLI mode*/; |
| 1151 | } |
| 1152 | |
| 1153 | {/* set up JSON output formatting options. */ |
| 1154 | int indent = -1; |
| 1155 | indent = json_find_option_int("indent",NULL,"I",-1); |
| 1156 | g.json.outOpt.indentation = (0>indent) |
| 1157 | ? (g.isHTTP ? 0 : 1) |
| 1158 | : (unsigned char)indent; |
| 1159 | g.json.outOpt.addNewline = g.isHTTP |
| @@ -1331,11 +1329,10 @@ | |
| 1329 | if(!g.json.cmd.a){ |
| 1330 | return NULL; |
| 1331 | }else{ |
| 1332 | cson_value * rc = NULL; |
| 1333 | Blob path = empty_blob; |
| 1334 | unsigned int aLen = g.json.dispatchDepth+1; /*cson_array_length_get(g.json.cmd.a);*/ |
| 1335 | unsigned int i = 1; |
| 1336 | for( ; i < aLen; ++i ){ |
| 1337 | char const * part = cson_string_cstr(cson_value_get_string(cson_array_get(g.json.cmd.a, i))); |
| 1338 | if(!part){ |
| 1339 |
+48
-14
| --- src/json_artifact.c | ||
| +++ src/json_artifact.c | ||
| @@ -48,31 +48,49 @@ | ||
| 48 | 48 | payload.artifact property of /json/artifact responses. |
| 49 | 49 | */ |
| 50 | 50 | artifact_f func; |
| 51 | 51 | } ArtifactDispatchEntry; |
| 52 | 52 | |
| 53 | + | |
| 54 | +/* | |
| 55 | +** Generates a JSON Array reference holding the parent UUIDs (as strings). | |
| 56 | +** If it finds no matches then it returns NULL (OOM is a fatal error). | |
| 57 | +** | |
| 58 | +** Returned value is NULL or an Array owned by the caller. | |
| 59 | +*/ | |
| 60 | +cson_value * json_parent_uuids_for_ci( int rid ){ | |
| 61 | + Stmt q = empty_Stmt; | |
| 62 | + cson_array * pParents = NULL; | |
| 63 | + db_prepare( &q, | |
| 64 | + "SELECT uuid FROM plink, blob" | |
| 65 | + " WHERE plink.cid=%d AND blob.rid=plink.pid" | |
| 66 | + " ORDER BY plink.isprim DESC", | |
| 67 | + rid ); | |
| 68 | + while( SQLITE_ROW==db_step(&q) ){ | |
| 69 | + if(!pParents) { | |
| 70 | + pParents = cson_new_array(); | |
| 71 | + } | |
| 72 | + cson_array_append( pParents, cson_sqlite3_column_to_value( q.pStmt, 0 ) ); | |
| 73 | + } | |
| 74 | + db_finalize(&q); | |
| 75 | + return cson_array_value(pParents); | |
| 76 | +} | |
| 53 | 77 | |
| 54 | 78 | /* |
| 55 | 79 | ** Generates an artifact Object for the given rid, |
| 56 | 80 | ** which must refer to a Checkin. |
| 57 | 81 | ** |
| 58 | 82 | ** Returned value is NULL or an Object owned by the caller. |
| 59 | 83 | */ |
| 60 | 84 | cson_value * json_artifact_for_ci( int rid, char showFiles ){ |
| 61 | - char * zParent = NULL; | |
| 62 | 85 | cson_value * v = NULL; |
| 63 | 86 | Stmt q; |
| 64 | 87 | static cson_value * eventTypeLabel = NULL; |
| 65 | 88 | if(!eventTypeLabel){ |
| 66 | 89 | eventTypeLabel = json_new_string("checkin"); |
| 67 | 90 | json_gc_add("$EVENT_TYPE_LABEL(commit)", eventTypeLabel); |
| 68 | 91 | } |
| 69 | - zParent = db_text(0, | |
| 70 | - "SELECT uuid FROM plink, blob" | |
| 71 | - " WHERE plink.cid=%d AND blob.rid=plink.pid AND plink.isprim", | |
| 72 | - rid | |
| 73 | - ); | |
| 74 | 92 | |
| 75 | 93 | db_prepare(&q, |
| 76 | 94 | "SELECT uuid, " |
| 77 | 95 | " cast(strftime('%%s',mtime) as int), " |
| 78 | 96 | " user, " |
| @@ -85,14 +103,17 @@ | ||
| 85 | 103 | ); |
| 86 | 104 | if( db_step(&q)==SQLITE_ROW ){ |
| 87 | 105 | cson_object * o; |
| 88 | 106 | cson_value * tmpV = NULL; |
| 89 | 107 | const char *zUuid = db_column_text(&q, 0); |
| 90 | - char * zTmp; | |
| 91 | 108 | const char *zUser; |
| 92 | 109 | const char *zComment; |
| 93 | 110 | char * zEUser, * zEComment; |
| 111 | +#define ADD_PRIMARY_PARENT_UUID 0 /* temporary local macro */ | |
| 112 | +#if ADD_PRIMARY_PARENT_UUID | |
| 113 | + char * zParent = NULL; | |
| 114 | +#endif | |
| 94 | 115 | int mtime, omtime; |
| 95 | 116 | v = cson_value_new_object(); |
| 96 | 117 | o = cson_value_get_object(v); |
| 97 | 118 | #define SET(K,V) cson_object_set(o,(K), (V)) |
| 98 | 119 | SET("type", eventTypeLabel ); |
| @@ -131,30 +152,43 @@ | ||
| 131 | 152 | omtime = db_column_int(&q,4); |
| 132 | 153 | if(omtime && (omtime!=mtime)){ |
| 133 | 154 | SET("originTime",json_new_int(omtime)); |
| 134 | 155 | } |
| 135 | 156 | |
| 136 | - if(zParent){ | |
| 137 | - SET("parentUuid", json_new_string(zParent)); | |
| 157 | +#if ADD_PRIMARY_PARENT_UUID | |
| 158 | + zParent = db_text(0, | |
| 159 | + "SELECT uuid FROM plink, blob" | |
| 160 | + " WHERE plink.cid=%d AND blob.rid=plink.pid" | |
| 161 | + " AND plink.isprim", | |
| 162 | + rid | |
| 163 | + ); | |
| 164 | + tmpV = zParent ? json_new_string(zParent) : cson_value_null(); | |
| 165 | + free(zParent); | |
| 166 | + zParent = NULL; | |
| 167 | + SET("parentUuid", tmpV ); | |
| 168 | +#endif | |
| 169 | +#undef ADD_PRIMARY_PARENT_UUID | |
| 170 | + | |
| 171 | + tmpV = json_parent_uuids_for_ci(rid); | |
| 172 | + if(tmpV){ | |
| 173 | + SET("parents", tmpV); | |
| 138 | 174 | } |
| 139 | 175 | |
| 140 | 176 | tmpV = json_tags_for_checkin_rid(rid,0); |
| 141 | 177 | if(tmpV){ |
| 142 | 178 | SET("tags",tmpV); |
| 143 | 179 | } |
| 144 | 180 | |
| 145 | 181 | if( showFiles ){ |
| 146 | - cson_value * fileList = json_get_changed_files(rid); | |
| 147 | - if(fileList){ | |
| 148 | - SET("files",fileList); | |
| 182 | + tmpV = json_get_changed_files(rid); | |
| 183 | + if(tmpV){ | |
| 184 | + SET("files",tmpV); | |
| 149 | 185 | } |
| 150 | 186 | } |
| 151 | 187 | |
| 152 | - | |
| 153 | 188 | #undef SET |
| 154 | 189 | } |
| 155 | - free(zParent); | |
| 156 | 190 | db_finalize(&q); |
| 157 | 191 | return v; |
| 158 | 192 | } |
| 159 | 193 | |
| 160 | 194 | /* |
| 161 | 195 |
| --- src/json_artifact.c | |
| +++ src/json_artifact.c | |
| @@ -48,31 +48,49 @@ | |
| 48 | payload.artifact property of /json/artifact responses. |
| 49 | */ |
| 50 | artifact_f func; |
| 51 | } ArtifactDispatchEntry; |
| 52 | |
| 53 | |
| 54 | /* |
| 55 | ** Generates an artifact Object for the given rid, |
| 56 | ** which must refer to a Checkin. |
| 57 | ** |
| 58 | ** Returned value is NULL or an Object owned by the caller. |
| 59 | */ |
| 60 | cson_value * json_artifact_for_ci( int rid, char showFiles ){ |
| 61 | char * zParent = NULL; |
| 62 | cson_value * v = NULL; |
| 63 | Stmt q; |
| 64 | static cson_value * eventTypeLabel = NULL; |
| 65 | if(!eventTypeLabel){ |
| 66 | eventTypeLabel = json_new_string("checkin"); |
| 67 | json_gc_add("$EVENT_TYPE_LABEL(commit)", eventTypeLabel); |
| 68 | } |
| 69 | zParent = db_text(0, |
| 70 | "SELECT uuid FROM plink, blob" |
| 71 | " WHERE plink.cid=%d AND blob.rid=plink.pid AND plink.isprim", |
| 72 | rid |
| 73 | ); |
| 74 | |
| 75 | db_prepare(&q, |
| 76 | "SELECT uuid, " |
| 77 | " cast(strftime('%%s',mtime) as int), " |
| 78 | " user, " |
| @@ -85,14 +103,17 @@ | |
| 85 | ); |
| 86 | if( db_step(&q)==SQLITE_ROW ){ |
| 87 | cson_object * o; |
| 88 | cson_value * tmpV = NULL; |
| 89 | const char *zUuid = db_column_text(&q, 0); |
| 90 | char * zTmp; |
| 91 | const char *zUser; |
| 92 | const char *zComment; |
| 93 | char * zEUser, * zEComment; |
| 94 | int mtime, omtime; |
| 95 | v = cson_value_new_object(); |
| 96 | o = cson_value_get_object(v); |
| 97 | #define SET(K,V) cson_object_set(o,(K), (V)) |
| 98 | SET("type", eventTypeLabel ); |
| @@ -131,30 +152,43 @@ | |
| 131 | omtime = db_column_int(&q,4); |
| 132 | if(omtime && (omtime!=mtime)){ |
| 133 | SET("originTime",json_new_int(omtime)); |
| 134 | } |
| 135 | |
| 136 | if(zParent){ |
| 137 | SET("parentUuid", json_new_string(zParent)); |
| 138 | } |
| 139 | |
| 140 | tmpV = json_tags_for_checkin_rid(rid,0); |
| 141 | if(tmpV){ |
| 142 | SET("tags",tmpV); |
| 143 | } |
| 144 | |
| 145 | if( showFiles ){ |
| 146 | cson_value * fileList = json_get_changed_files(rid); |
| 147 | if(fileList){ |
| 148 | SET("files",fileList); |
| 149 | } |
| 150 | } |
| 151 | |
| 152 | |
| 153 | #undef SET |
| 154 | } |
| 155 | free(zParent); |
| 156 | db_finalize(&q); |
| 157 | return v; |
| 158 | } |
| 159 | |
| 160 | /* |
| 161 |
| --- src/json_artifact.c | |
| +++ src/json_artifact.c | |
| @@ -48,31 +48,49 @@ | |
| 48 | payload.artifact property of /json/artifact responses. |
| 49 | */ |
| 50 | artifact_f func; |
| 51 | } ArtifactDispatchEntry; |
| 52 | |
| 53 | |
| 54 | /* |
| 55 | ** Generates a JSON Array reference holding the parent UUIDs (as strings). |
| 56 | ** If it finds no matches then it returns NULL (OOM is a fatal error). |
| 57 | ** |
| 58 | ** Returned value is NULL or an Array owned by the caller. |
| 59 | */ |
| 60 | cson_value * json_parent_uuids_for_ci( int rid ){ |
| 61 | Stmt q = empty_Stmt; |
| 62 | cson_array * pParents = NULL; |
| 63 | db_prepare( &q, |
| 64 | "SELECT uuid FROM plink, blob" |
| 65 | " WHERE plink.cid=%d AND blob.rid=plink.pid" |
| 66 | " ORDER BY plink.isprim DESC", |
| 67 | rid ); |
| 68 | while( SQLITE_ROW==db_step(&q) ){ |
| 69 | if(!pParents) { |
| 70 | pParents = cson_new_array(); |
| 71 | } |
| 72 | cson_array_append( pParents, cson_sqlite3_column_to_value( q.pStmt, 0 ) ); |
| 73 | } |
| 74 | db_finalize(&q); |
| 75 | return cson_array_value(pParents); |
| 76 | } |
| 77 | |
| 78 | /* |
| 79 | ** Generates an artifact Object for the given rid, |
| 80 | ** which must refer to a Checkin. |
| 81 | ** |
| 82 | ** Returned value is NULL or an Object owned by the caller. |
| 83 | */ |
| 84 | cson_value * json_artifact_for_ci( int rid, char showFiles ){ |
| 85 | cson_value * v = NULL; |
| 86 | Stmt q; |
| 87 | static cson_value * eventTypeLabel = NULL; |
| 88 | if(!eventTypeLabel){ |
| 89 | eventTypeLabel = json_new_string("checkin"); |
| 90 | json_gc_add("$EVENT_TYPE_LABEL(commit)", eventTypeLabel); |
| 91 | } |
| 92 | |
| 93 | db_prepare(&q, |
| 94 | "SELECT uuid, " |
| 95 | " cast(strftime('%%s',mtime) as int), " |
| 96 | " user, " |
| @@ -85,14 +103,17 @@ | |
| 103 | ); |
| 104 | if( db_step(&q)==SQLITE_ROW ){ |
| 105 | cson_object * o; |
| 106 | cson_value * tmpV = NULL; |
| 107 | const char *zUuid = db_column_text(&q, 0); |
| 108 | const char *zUser; |
| 109 | const char *zComment; |
| 110 | char * zEUser, * zEComment; |
| 111 | #define ADD_PRIMARY_PARENT_UUID 0 /* temporary local macro */ |
| 112 | #if ADD_PRIMARY_PARENT_UUID |
| 113 | char * zParent = NULL; |
| 114 | #endif |
| 115 | int mtime, omtime; |
| 116 | v = cson_value_new_object(); |
| 117 | o = cson_value_get_object(v); |
| 118 | #define SET(K,V) cson_object_set(o,(K), (V)) |
| 119 | SET("type", eventTypeLabel ); |
| @@ -131,30 +152,43 @@ | |
| 152 | omtime = db_column_int(&q,4); |
| 153 | if(omtime && (omtime!=mtime)){ |
| 154 | SET("originTime",json_new_int(omtime)); |
| 155 | } |
| 156 | |
| 157 | #if ADD_PRIMARY_PARENT_UUID |
| 158 | zParent = db_text(0, |
| 159 | "SELECT uuid FROM plink, blob" |
| 160 | " WHERE plink.cid=%d AND blob.rid=plink.pid" |
| 161 | " AND plink.isprim", |
| 162 | rid |
| 163 | ); |
| 164 | tmpV = zParent ? json_new_string(zParent) : cson_value_null(); |
| 165 | free(zParent); |
| 166 | zParent = NULL; |
| 167 | SET("parentUuid", tmpV ); |
| 168 | #endif |
| 169 | #undef ADD_PRIMARY_PARENT_UUID |
| 170 | |
| 171 | tmpV = json_parent_uuids_for_ci(rid); |
| 172 | if(tmpV){ |
| 173 | SET("parents", tmpV); |
| 174 | } |
| 175 | |
| 176 | tmpV = json_tags_for_checkin_rid(rid,0); |
| 177 | if(tmpV){ |
| 178 | SET("tags",tmpV); |
| 179 | } |
| 180 | |
| 181 | if( showFiles ){ |
| 182 | tmpV = json_get_changed_files(rid); |
| 183 | if(tmpV){ |
| 184 | SET("files",tmpV); |
| 185 | } |
| 186 | } |
| 187 | |
| 188 | #undef SET |
| 189 | } |
| 190 | db_finalize(&q); |
| 191 | return v; |
| 192 | } |
| 193 | |
| 194 | /* |
| 195 |
-1
| --- src/json_diff.c | ||
| +++ src/json_diff.c | ||
| @@ -37,11 +37,10 @@ | ||
| 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 |
| --- src/json_diff.c | |
| +++ src/json_diff.c | |
| @@ -37,11 +37,10 @@ | |
| 37 | int fromid; |
| 38 | int toid; |
| 39 | int outLen; |
| 40 | Blob from = empty_blob, to = empty_blob, out = empty_blob; |
| 41 | cson_value * rc = NULL; |
| 42 | char const * zType = "ci"; |
| 43 | int flags = (DIFF_CONTEXT_MASK & nContext) |
| 44 | | (fSbs ? DIFF_SIDEBYSIDE : 0); |
| 45 | fromid = name_to_typed_rid(zFrom, "*"); |
| 46 | if(fromid<=0){ |
| 47 | json_set_err(FSL_JSON_E_UNRESOLVED_UUID, |
| 48 |
| --- src/json_diff.c | |
| +++ src/json_diff.c | |
| @@ -37,11 +37,10 @@ | |
| 37 | int fromid; |
| 38 | int toid; |
| 39 | int outLen; |
| 40 | Blob from = empty_blob, to = empty_blob, out = empty_blob; |
| 41 | cson_value * rc = NULL; |
| 42 | int flags = (DIFF_CONTEXT_MASK & nContext) |
| 43 | | (fSbs ? DIFF_SIDEBYSIDE : 0); |
| 44 | fromid = name_to_typed_rid(zFrom, "*"); |
| 45 | if(fromid<=0){ |
| 46 | json_set_err(FSL_JSON_E_UNRESOLVED_UUID, |
| 47 |
+1
-2
| --- src/json_timeline.c | ||
| +++ src/json_timeline.c | ||
| @@ -405,11 +405,11 @@ | ||
| 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; |
| @@ -429,11 +429,10 @@ | ||
| 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 |
| --- src/json_timeline.c | |
| +++ src/json_timeline.c | |
| @@ -405,11 +405,11 @@ | |
| 405 | cson_value_free( cson_string_value(tags) ); |
| 406 | cson_value_free( cson_string_value(isLeaf) ); |
| 407 | } |
| 408 | |
| 409 | goto end; |
| 410 | error: |
| 411 | assert( 0 != g.json.resultCode ); |
| 412 | cson_value_free(pay); |
| 413 | |
| 414 | end: |
| 415 | return pay; |
| @@ -429,11 +429,10 @@ | |
| 429 | cson_array * list = NULL; |
| 430 | int check = 0; |
| 431 | char showFiles = -1/*magic number*/; |
| 432 | Stmt q = empty_Stmt; |
| 433 | char warnRowToJsonFailed = 0; |
| 434 | char warnStringToArrayFailed = 0; |
| 435 | Blob sql = empty_blob; |
| 436 | if( !g.perm.Read ){ |
| 437 | /* IMO this falls more under the category of g.perm.History, but |
| 438 | i'm following the original timeline impl here. |
| 439 | */ |
| 440 |
| --- src/json_timeline.c | |
| +++ src/json_timeline.c | |
| @@ -405,11 +405,11 @@ | |
| 405 | cson_value_free( cson_string_value(tags) ); |
| 406 | cson_value_free( cson_string_value(isLeaf) ); |
| 407 | } |
| 408 | |
| 409 | goto end; |
| 410 | |
| 411 | assert( 0 != g.json.resultCode ); |
| 412 | cson_value_free(pay); |
| 413 | |
| 414 | end: |
| 415 | return pay; |
| @@ -429,11 +429,10 @@ | |
| 429 | cson_array * list = NULL; |
| 430 | int check = 0; |
| 431 | char showFiles = -1/*magic number*/; |
| 432 | Stmt q = empty_Stmt; |
| 433 | char warnRowToJsonFailed = 0; |
| 434 | Blob sql = empty_blob; |
| 435 | if( !g.perm.Read ){ |
| 436 | /* IMO this falls more under the category of g.perm.History, but |
| 437 | i'm following the original timeline impl here. |
| 438 | */ |
| 439 |
+9
-6
| --- src/json_wiki.c | ||
| +++ src/json_wiki.c | ||
| @@ -163,18 +163,13 @@ | ||
| 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 | } |
| @@ -347,10 +342,12 @@ | ||
| 347 | 342 | */ |
| 348 | 343 | static cson_value * json_wiki_list(){ |
| 349 | 344 | cson_value * listV = NULL; |
| 350 | 345 | cson_array * list = NULL; |
| 351 | 346 | Stmt q; |
| 347 | + char const verbose = json_find_option_bool("verbose",NULL,"v",0); | |
| 348 | + | |
| 352 | 349 | if( !g.perm.RdWiki && !g.perm.Read ){ |
| 353 | 350 | json_set_err(FSL_JSON_E_DENIED, |
| 354 | 351 | "Requires 'j' or 'o' permissions."); |
| 355 | 352 | return NULL; |
| 356 | 353 | } |
| @@ -359,11 +356,17 @@ | ||
| 359 | 356 | " FROM tag WHERE tagname GLOB 'wiki-*'" |
| 360 | 357 | " ORDER BY lower(name)"); |
| 361 | 358 | listV = cson_value_new_array(); |
| 362 | 359 | list = cson_value_get_array(listV); |
| 363 | 360 | while( SQLITE_ROW == db_step(&q) ){ |
| 364 | - cson_value * v = cson_sqlite3_column_to_value(q.pStmt,0); | |
| 361 | + cson_value * v; | |
| 362 | + if( verbose ){ | |
| 363 | + char const * name = db_column_text(&q,0); | |
| 364 | + v = json_get_wiki_page_by_name(name,0); | |
| 365 | + }else{ | |
| 366 | + v = cson_sqlite3_column_to_value(q.pStmt,0); | |
| 367 | + } | |
| 365 | 368 | if(!v){ |
| 366 | 369 | json_set_err(FSL_JSON_E_UNKNOWN, |
| 367 | 370 | "Could not convert wiki name column to JSON."); |
| 368 | 371 | goto error; |
| 369 | 372 | }else if( 0 != cson_array_append( list, v ) ){ |
| 370 | 373 |
| --- src/json_wiki.c | |
| +++ src/json_wiki.c | |
| @@ -163,18 +163,13 @@ | |
| 163 | /* |
| 164 | ** Implementation of /json/wiki/get. |
| 165 | ** |
| 166 | */ |
| 167 | static cson_value * json_wiki_get(){ |
| 168 | int rid; |
| 169 | Manifest *pWiki = 0; |
| 170 | char const * zBody = NULL; |
| 171 | char const * zPageName; |
| 172 | char const * zFormat = NULL; |
| 173 | char * zUuid = NULL; |
| 174 | char contentFormat = -1; |
| 175 | Stmt q; |
| 176 | if( !g.perm.RdWiki && !g.perm.Read ){ |
| 177 | json_set_err(FSL_JSON_E_DENIED, |
| 178 | "Requires 'o' or 'j' access."); |
| 179 | return NULL; |
| 180 | } |
| @@ -347,10 +342,12 @@ | |
| 347 | */ |
| 348 | static cson_value * json_wiki_list(){ |
| 349 | cson_value * listV = NULL; |
| 350 | cson_array * list = NULL; |
| 351 | Stmt q; |
| 352 | if( !g.perm.RdWiki && !g.perm.Read ){ |
| 353 | json_set_err(FSL_JSON_E_DENIED, |
| 354 | "Requires 'j' or 'o' permissions."); |
| 355 | return NULL; |
| 356 | } |
| @@ -359,11 +356,17 @@ | |
| 359 | " FROM tag WHERE tagname GLOB 'wiki-*'" |
| 360 | " ORDER BY lower(name)"); |
| 361 | listV = cson_value_new_array(); |
| 362 | list = cson_value_get_array(listV); |
| 363 | while( SQLITE_ROW == db_step(&q) ){ |
| 364 | cson_value * v = cson_sqlite3_column_to_value(q.pStmt,0); |
| 365 | if(!v){ |
| 366 | json_set_err(FSL_JSON_E_UNKNOWN, |
| 367 | "Could not convert wiki name column to JSON."); |
| 368 | goto error; |
| 369 | }else if( 0 != cson_array_append( list, v ) ){ |
| 370 |
| --- src/json_wiki.c | |
| +++ src/json_wiki.c | |
| @@ -163,18 +163,13 @@ | |
| 163 | /* |
| 164 | ** Implementation of /json/wiki/get. |
| 165 | ** |
| 166 | */ |
| 167 | static cson_value * json_wiki_get(){ |
| 168 | char const * zPageName; |
| 169 | char const * zFormat = NULL; |
| 170 | char contentFormat = -1; |
| 171 | if( !g.perm.RdWiki && !g.perm.Read ){ |
| 172 | json_set_err(FSL_JSON_E_DENIED, |
| 173 | "Requires 'o' or 'j' access."); |
| 174 | return NULL; |
| 175 | } |
| @@ -347,10 +342,12 @@ | |
| 342 | */ |
| 343 | static cson_value * json_wiki_list(){ |
| 344 | cson_value * listV = NULL; |
| 345 | cson_array * list = NULL; |
| 346 | Stmt q; |
| 347 | char const verbose = json_find_option_bool("verbose",NULL,"v",0); |
| 348 | |
| 349 | if( !g.perm.RdWiki && !g.perm.Read ){ |
| 350 | json_set_err(FSL_JSON_E_DENIED, |
| 351 | "Requires 'j' or 'o' permissions."); |
| 352 | return NULL; |
| 353 | } |
| @@ -359,11 +356,17 @@ | |
| 356 | " FROM tag WHERE tagname GLOB 'wiki-*'" |
| 357 | " ORDER BY lower(name)"); |
| 358 | listV = cson_value_new_array(); |
| 359 | list = cson_value_get_array(listV); |
| 360 | while( SQLITE_ROW == db_step(&q) ){ |
| 361 | cson_value * v; |
| 362 | if( verbose ){ |
| 363 | char const * name = db_column_text(&q,0); |
| 364 | v = json_get_wiki_page_by_name(name,0); |
| 365 | }else{ |
| 366 | v = cson_sqlite3_column_to_value(q.pStmt,0); |
| 367 | } |
| 368 | if(!v){ |
| 369 | json_set_err(FSL_JSON_E_UNKNOWN, |
| 370 | "Could not convert wiki name column to JSON."); |
| 371 | goto error; |
| 372 | }else if( 0 != cson_array_append( list, v ) ){ |
| 373 |
+5
-1
| --- src/makemake.tcl | ||
| +++ src/makemake.tcl | ||
| @@ -341,10 +341,14 @@ | ||
| 341 | 341 | # will run on the platform that is doing the build. This is used |
| 342 | 342 | # to compile code-generator programs as part of the build process. |
| 343 | 343 | # See TCC below for the C compiler for building the finished binary. |
| 344 | 344 | # |
| 345 | 345 | BCC = gcc |
| 346 | + | |
| 347 | +#### Enable JSON (http://www.json.org) support using "cson" | |
| 348 | +# | |
| 349 | +# FOSSIL_ENABLE_JSON = 1 | |
| 346 | 350 | |
| 347 | 351 | #### Enable HTTPS support via OpenSSL (links to libssl and libcrypto) |
| 348 | 352 | # |
| 349 | 353 | # FOSSIL_ENABLE_SSL = 1 |
| 350 | 354 | |
| @@ -435,11 +439,11 @@ | ||
| 435 | 439 | TCC += -DFOSSIL_ENABLE_TCL=1 -DSTATIC_BUILD |
| 436 | 440 | endif |
| 437 | 441 | |
| 438 | 442 | # With JSON support |
| 439 | 443 | ifdef FOSSIL_ENABLE_JSON |
| 440 | -TCC += -DFOSSIL_ENABLE_JSON | |
| 444 | +TCC += -DFOSSIL_ENABLE_JSON=1 | |
| 441 | 445 | endif |
| 442 | 446 | |
| 443 | 447 | #### Extra arguments for linking the finished binary. Fossil needs |
| 444 | 448 | # to link against the Z-Lib compression library. There are no |
| 445 | 449 | # other mandatory dependencies. We add the -static option here |
| 446 | 450 |
| --- src/makemake.tcl | |
| +++ src/makemake.tcl | |
| @@ -341,10 +341,14 @@ | |
| 341 | # will run on the platform that is doing the build. This is used |
| 342 | # to compile code-generator programs as part of the build process. |
| 343 | # See TCC below for the C compiler for building the finished binary. |
| 344 | # |
| 345 | BCC = gcc |
| 346 | |
| 347 | #### Enable HTTPS support via OpenSSL (links to libssl and libcrypto) |
| 348 | # |
| 349 | # FOSSIL_ENABLE_SSL = 1 |
| 350 | |
| @@ -435,11 +439,11 @@ | |
| 435 | TCC += -DFOSSIL_ENABLE_TCL=1 -DSTATIC_BUILD |
| 436 | endif |
| 437 | |
| 438 | # With JSON support |
| 439 | ifdef FOSSIL_ENABLE_JSON |
| 440 | TCC += -DFOSSIL_ENABLE_JSON |
| 441 | endif |
| 442 | |
| 443 | #### Extra arguments for linking the finished binary. Fossil needs |
| 444 | # to link against the Z-Lib compression library. There are no |
| 445 | # other mandatory dependencies. We add the -static option here |
| 446 |
| --- src/makemake.tcl | |
| +++ src/makemake.tcl | |
| @@ -341,10 +341,14 @@ | |
| 341 | # will run on the platform that is doing the build. This is used |
| 342 | # to compile code-generator programs as part of the build process. |
| 343 | # See TCC below for the C compiler for building the finished binary. |
| 344 | # |
| 345 | BCC = gcc |
| 346 | |
| 347 | #### Enable JSON (http://www.json.org) support using "cson" |
| 348 | # |
| 349 | # FOSSIL_ENABLE_JSON = 1 |
| 350 | |
| 351 | #### Enable HTTPS support via OpenSSL (links to libssl and libcrypto) |
| 352 | # |
| 353 | # FOSSIL_ENABLE_SSL = 1 |
| 354 | |
| @@ -435,11 +439,11 @@ | |
| 439 | TCC += -DFOSSIL_ENABLE_TCL=1 -DSTATIC_BUILD |
| 440 | endif |
| 441 | |
| 442 | # With JSON support |
| 443 | ifdef FOSSIL_ENABLE_JSON |
| 444 | TCC += -DFOSSIL_ENABLE_JSON=1 |
| 445 | endif |
| 446 | |
| 447 | #### Extra arguments for linking the finished binary. Fossil needs |
| 448 | # to link against the Z-Lib compression library. There are no |
| 449 | # other mandatory dependencies. We add the -static option here |
| 450 |
+10
-4
| --- src/merge3.c | ||
| +++ src/merge3.c | ||
| @@ -395,25 +395,29 @@ | ||
| 395 | 395 | Blob *pV2, /* Version merging from (yours) */ |
| 396 | 396 | Blob *pOut /* Output written here */ |
| 397 | 397 | ){ |
| 398 | 398 | Blob v1; /* Content of zV1 */ |
| 399 | 399 | int rc; /* Return code of subroutines and this routine */ |
| 400 | + char *zPivot; /* Name of the pivot file */ | |
| 401 | + char *zOrig; /* Name of the original content file */ | |
| 402 | + char *zOther; /* Name of the merge file */ | |
| 400 | 403 | |
| 401 | 404 | blob_read_from_file(&v1, zV1); |
| 402 | 405 | rc = blob_merge(pPivot, &v1, pV2, pOut); |
| 403 | - if( rc>0 ){ | |
| 404 | - char *zPivot; /* Name of the pivot file */ | |
| 405 | - char *zOrig; /* Name of the original content file */ | |
| 406 | - char *zOther; /* Name of the merge file */ | |
| 406 | + if( rc!=0 ){ | |
| 407 | 407 | const char *zGMerge; /* Name of the gmerge command */ |
| 408 | 408 | |
| 409 | 409 | zPivot = file_newname(zV1, "baseline", 1); |
| 410 | 410 | blob_write_to_file(pPivot, zPivot); |
| 411 | 411 | zOrig = file_newname(zV1, "original", 1); |
| 412 | 412 | blob_write_to_file(&v1, zOrig); |
| 413 | 413 | zOther = file_newname(zV1, "merge", 1); |
| 414 | 414 | blob_write_to_file(pV2, zOther); |
| 415 | + } | |
| 416 | + if( rc>0 ){ | |
| 417 | + const char *zGMerge; /* Name of the gmerge command */ | |
| 418 | + | |
| 415 | 419 | zGMerge = db_get("gmerge-command", 0); |
| 416 | 420 | if( zGMerge && zGMerge[0] ){ |
| 417 | 421 | char *zOut; /* Temporary output file */ |
| 418 | 422 | char *zCmd; /* Command to invoke */ |
| 419 | 423 | const char *azSubst[8]; /* Strings to be substituted */ |
| @@ -434,12 +438,14 @@ | ||
| 434 | 438 | file_delete(zOut); |
| 435 | 439 | } |
| 436 | 440 | fossil_free(zCmd); |
| 437 | 441 | fossil_free(zOut); |
| 438 | 442 | } |
| 443 | + } | |
| 444 | + if( rc!=0 ){ | |
| 439 | 445 | fossil_free(zPivot); |
| 440 | 446 | fossil_free(zOrig); |
| 441 | 447 | fossil_free(zOther); |
| 442 | 448 | } |
| 443 | 449 | blob_reset(&v1); |
| 444 | 450 | return rc; |
| 445 | 451 | } |
| 446 | 452 |
| --- src/merge3.c | |
| +++ src/merge3.c | |
| @@ -395,25 +395,29 @@ | |
| 395 | Blob *pV2, /* Version merging from (yours) */ |
| 396 | Blob *pOut /* Output written here */ |
| 397 | ){ |
| 398 | Blob v1; /* Content of zV1 */ |
| 399 | int rc; /* Return code of subroutines and this routine */ |
| 400 | |
| 401 | blob_read_from_file(&v1, zV1); |
| 402 | rc = blob_merge(pPivot, &v1, pV2, pOut); |
| 403 | if( rc>0 ){ |
| 404 | char *zPivot; /* Name of the pivot file */ |
| 405 | char *zOrig; /* Name of the original content file */ |
| 406 | char *zOther; /* Name of the merge file */ |
| 407 | const char *zGMerge; /* Name of the gmerge command */ |
| 408 | |
| 409 | zPivot = file_newname(zV1, "baseline", 1); |
| 410 | blob_write_to_file(pPivot, zPivot); |
| 411 | zOrig = file_newname(zV1, "original", 1); |
| 412 | blob_write_to_file(&v1, zOrig); |
| 413 | zOther = file_newname(zV1, "merge", 1); |
| 414 | blob_write_to_file(pV2, zOther); |
| 415 | zGMerge = db_get("gmerge-command", 0); |
| 416 | if( zGMerge && zGMerge[0] ){ |
| 417 | char *zOut; /* Temporary output file */ |
| 418 | char *zCmd; /* Command to invoke */ |
| 419 | const char *azSubst[8]; /* Strings to be substituted */ |
| @@ -434,12 +438,14 @@ | |
| 434 | file_delete(zOut); |
| 435 | } |
| 436 | fossil_free(zCmd); |
| 437 | fossil_free(zOut); |
| 438 | } |
| 439 | fossil_free(zPivot); |
| 440 | fossil_free(zOrig); |
| 441 | fossil_free(zOther); |
| 442 | } |
| 443 | blob_reset(&v1); |
| 444 | return rc; |
| 445 | } |
| 446 |
| --- src/merge3.c | |
| +++ src/merge3.c | |
| @@ -395,25 +395,29 @@ | |
| 395 | Blob *pV2, /* Version merging from (yours) */ |
| 396 | Blob *pOut /* Output written here */ |
| 397 | ){ |
| 398 | Blob v1; /* Content of zV1 */ |
| 399 | int rc; /* Return code of subroutines and this routine */ |
| 400 | char *zPivot; /* Name of the pivot file */ |
| 401 | char *zOrig; /* Name of the original content file */ |
| 402 | char *zOther; /* Name of the merge file */ |
| 403 | |
| 404 | blob_read_from_file(&v1, zV1); |
| 405 | rc = blob_merge(pPivot, &v1, pV2, pOut); |
| 406 | if( rc!=0 ){ |
| 407 | const char *zGMerge; /* Name of the gmerge command */ |
| 408 | |
| 409 | zPivot = file_newname(zV1, "baseline", 1); |
| 410 | blob_write_to_file(pPivot, zPivot); |
| 411 | zOrig = file_newname(zV1, "original", 1); |
| 412 | blob_write_to_file(&v1, zOrig); |
| 413 | zOther = file_newname(zV1, "merge", 1); |
| 414 | blob_write_to_file(pV2, zOther); |
| 415 | } |
| 416 | if( rc>0 ){ |
| 417 | const char *zGMerge; /* Name of the gmerge command */ |
| 418 | |
| 419 | zGMerge = db_get("gmerge-command", 0); |
| 420 | if( zGMerge && zGMerge[0] ){ |
| 421 | char *zOut; /* Temporary output file */ |
| 422 | char *zCmd; /* Command to invoke */ |
| 423 | const char *azSubst[8]; /* Strings to be substituted */ |
| @@ -434,12 +438,14 @@ | |
| 438 | file_delete(zOut); |
| 439 | } |
| 440 | fossil_free(zCmd); |
| 441 | fossil_free(zOut); |
| 442 | } |
| 443 | } |
| 444 | if( rc!=0 ){ |
| 445 | fossil_free(zPivot); |
| 446 | fossil_free(zOrig); |
| 447 | fossil_free(zOther); |
| 448 | } |
| 449 | blob_reset(&v1); |
| 450 | return rc; |
| 451 | } |
| 452 |
+23
-15
| --- src/rebuild.c | ||
| +++ src/rebuild.c | ||
| @@ -424,10 +424,11 @@ | ||
| 424 | 424 | if( ttyOutput && !g.fQuiet && totalSize>0 ){ |
| 425 | 425 | processCnt += incrSize; |
| 426 | 426 | percent_complete((processCnt*1000)/totalSize); |
| 427 | 427 | } |
| 428 | 428 | if(!g.fQuiet && ttyOutput ){ |
| 429 | + percent_complete(1000); | |
| 429 | 430 | fossil_print("\n"); |
| 430 | 431 | } |
| 431 | 432 | return errCnt; |
| 432 | 433 | } |
| 433 | 434 | |
| @@ -485,10 +486,30 @@ | ||
| 485 | 486 | } |
| 486 | 487 | db_finalize(&q); |
| 487 | 488 | |
| 488 | 489 | db_end_transaction(0); |
| 489 | 490 | } |
| 491 | + | |
| 492 | + | |
| 493 | +/* Reconstruct the private table. The private table contains the rid | |
| 494 | +** of every manifest that is tagged with "private" and every file that | |
| 495 | +** is not used by a manifest that is not private. | |
| 496 | +*/ | |
| 497 | +static void reconstruct_private_table(void){ | |
| 498 | + db_multi_exec( | |
| 499 | + "CREATE TEMP TABLE private_ckin(rid INTEGER PRIMARY KEY);" | |
| 500 | + "INSERT INTO private_ckin " | |
| 501 | + " SELECT rid FROM tagxref WHERE tagid=%d AND tagtype>0;" | |
| 502 | + "INSERT OR IGNORE INTO private" | |
| 503 | + " SELECT fid FROM mlink" | |
| 504 | + " EXCEPT SELECT fid FROM mlink WHERE mid NOT IN private_ckin;" | |
| 505 | + "INSERT OR IGNORE INTO private SELECT rid FROM private_ckin;" | |
| 506 | + "DROP TABLE private_ckin;", TAG_PRIVATE | |
| 507 | + ); | |
| 508 | + fix_private_blob_dependencies(0); | |
| 509 | +} | |
| 510 | + | |
| 490 | 511 | |
| 491 | 512 | /* |
| 492 | 513 | ** COMMAND: rebuild |
| 493 | 514 | ** |
| 494 | 515 | ** Usage: %fossil rebuild ?REPOSITORY? ?OPTIONS? |
| @@ -551,10 +572,11 @@ | ||
| 551 | 572 | db_open_repository(g.zRepositoryName); |
| 552 | 573 | } |
| 553 | 574 | db_begin_transaction(); |
| 554 | 575 | ttyOutput = 1; |
| 555 | 576 | errCnt = rebuild_db(randomizeFlag, 1, doClustering); |
| 577 | + reconstruct_private_table(); | |
| 556 | 578 | db_multi_exec( |
| 557 | 579 | "REPLACE INTO config(name,value,mtime) VALUES('content-schema','%s',now());" |
| 558 | 580 | "REPLACE INTO config(name,value,mtime) VALUES('aux-schema','%s',now());", |
| 559 | 581 | CONTENT_SCHEMA, AUX_SCHEMA |
| 560 | 582 | ); |
| @@ -881,25 +903,11 @@ | ||
| 881 | 903 | fossil_print("Reading files from directory \"%s\"...\n", g.argv[3]); |
| 882 | 904 | recon_read_dir(g.argv[3]); |
| 883 | 905 | fossil_print("\nBuilding the Fossil repository...\n"); |
| 884 | 906 | |
| 885 | 907 | rebuild_db(0, 1, 1); |
| 886 | - | |
| 887 | - /* Reconstruct the private table. The private table contains the rid | |
| 888 | - ** of every manifest that is tagged with "private" and every file that | |
| 889 | - ** is not used by a manifest that is not private. | |
| 890 | - */ | |
| 891 | - db_multi_exec( | |
| 892 | - "CREATE TEMP TABLE private_ckin(rid INTEGER PRIMARY KEY);" | |
| 893 | - "INSERT INTO private_ckin " | |
| 894 | - " SELECT rid FROM tagxref WHERE tagid=%d AND tagtype>0;" | |
| 895 | - "INSERT OR IGNORE INTO private" | |
| 896 | - " SELECT fid FROM mlink" | |
| 897 | - " EXCEPT SELECT fid FROM mlink WHERE mid NOT IN private_ckin;" | |
| 898 | - "INSERT OR IGNORE INTO private SELECT rid FROM private_ckin;" | |
| 899 | - "DROP TABLE private_ckin;" | |
| 900 | - ); | |
| 908 | + reconstruct_private_table(); | |
| 901 | 909 | |
| 902 | 910 | /* Skip the verify_before_commit() step on a reconstruct. Most artifacts |
| 903 | 911 | ** will have been changed and verification therefore takes a really, really |
| 904 | 912 | ** long time. |
| 905 | 913 | */ |
| 906 | 914 |
| --- src/rebuild.c | |
| +++ src/rebuild.c | |
| @@ -424,10 +424,11 @@ | |
| 424 | if( ttyOutput && !g.fQuiet && totalSize>0 ){ |
| 425 | processCnt += incrSize; |
| 426 | percent_complete((processCnt*1000)/totalSize); |
| 427 | } |
| 428 | if(!g.fQuiet && ttyOutput ){ |
| 429 | fossil_print("\n"); |
| 430 | } |
| 431 | return errCnt; |
| 432 | } |
| 433 | |
| @@ -485,10 +486,30 @@ | |
| 485 | } |
| 486 | db_finalize(&q); |
| 487 | |
| 488 | db_end_transaction(0); |
| 489 | } |
| 490 | |
| 491 | /* |
| 492 | ** COMMAND: rebuild |
| 493 | ** |
| 494 | ** Usage: %fossil rebuild ?REPOSITORY? ?OPTIONS? |
| @@ -551,10 +572,11 @@ | |
| 551 | db_open_repository(g.zRepositoryName); |
| 552 | } |
| 553 | db_begin_transaction(); |
| 554 | ttyOutput = 1; |
| 555 | errCnt = rebuild_db(randomizeFlag, 1, doClustering); |
| 556 | db_multi_exec( |
| 557 | "REPLACE INTO config(name,value,mtime) VALUES('content-schema','%s',now());" |
| 558 | "REPLACE INTO config(name,value,mtime) VALUES('aux-schema','%s',now());", |
| 559 | CONTENT_SCHEMA, AUX_SCHEMA |
| 560 | ); |
| @@ -881,25 +903,11 @@ | |
| 881 | fossil_print("Reading files from directory \"%s\"...\n", g.argv[3]); |
| 882 | recon_read_dir(g.argv[3]); |
| 883 | fossil_print("\nBuilding the Fossil repository...\n"); |
| 884 | |
| 885 | rebuild_db(0, 1, 1); |
| 886 | |
| 887 | /* Reconstruct the private table. The private table contains the rid |
| 888 | ** of every manifest that is tagged with "private" and every file that |
| 889 | ** is not used by a manifest that is not private. |
| 890 | */ |
| 891 | db_multi_exec( |
| 892 | "CREATE TEMP TABLE private_ckin(rid INTEGER PRIMARY KEY);" |
| 893 | "INSERT INTO private_ckin " |
| 894 | " SELECT rid FROM tagxref WHERE tagid=%d AND tagtype>0;" |
| 895 | "INSERT OR IGNORE INTO private" |
| 896 | " SELECT fid FROM mlink" |
| 897 | " EXCEPT SELECT fid FROM mlink WHERE mid NOT IN private_ckin;" |
| 898 | "INSERT OR IGNORE INTO private SELECT rid FROM private_ckin;" |
| 899 | "DROP TABLE private_ckin;" |
| 900 | ); |
| 901 | |
| 902 | /* Skip the verify_before_commit() step on a reconstruct. Most artifacts |
| 903 | ** will have been changed and verification therefore takes a really, really |
| 904 | ** long time. |
| 905 | */ |
| 906 |
| --- src/rebuild.c | |
| +++ src/rebuild.c | |
| @@ -424,10 +424,11 @@ | |
| 424 | if( ttyOutput && !g.fQuiet && totalSize>0 ){ |
| 425 | processCnt += incrSize; |
| 426 | percent_complete((processCnt*1000)/totalSize); |
| 427 | } |
| 428 | if(!g.fQuiet && ttyOutput ){ |
| 429 | percent_complete(1000); |
| 430 | fossil_print("\n"); |
| 431 | } |
| 432 | return errCnt; |
| 433 | } |
| 434 | |
| @@ -485,10 +486,30 @@ | |
| 486 | } |
| 487 | db_finalize(&q); |
| 488 | |
| 489 | db_end_transaction(0); |
| 490 | } |
| 491 | |
| 492 | |
| 493 | /* Reconstruct the private table. The private table contains the rid |
| 494 | ** of every manifest that is tagged with "private" and every file that |
| 495 | ** is not used by a manifest that is not private. |
| 496 | */ |
| 497 | static void reconstruct_private_table(void){ |
| 498 | db_multi_exec( |
| 499 | "CREATE TEMP TABLE private_ckin(rid INTEGER PRIMARY KEY);" |
| 500 | "INSERT INTO private_ckin " |
| 501 | " SELECT rid FROM tagxref WHERE tagid=%d AND tagtype>0;" |
| 502 | "INSERT OR IGNORE INTO private" |
| 503 | " SELECT fid FROM mlink" |
| 504 | " EXCEPT SELECT fid FROM mlink WHERE mid NOT IN private_ckin;" |
| 505 | "INSERT OR IGNORE INTO private SELECT rid FROM private_ckin;" |
| 506 | "DROP TABLE private_ckin;", TAG_PRIVATE |
| 507 | ); |
| 508 | fix_private_blob_dependencies(0); |
| 509 | } |
| 510 | |
| 511 | |
| 512 | /* |
| 513 | ** COMMAND: rebuild |
| 514 | ** |
| 515 | ** Usage: %fossil rebuild ?REPOSITORY? ?OPTIONS? |
| @@ -551,10 +572,11 @@ | |
| 572 | db_open_repository(g.zRepositoryName); |
| 573 | } |
| 574 | db_begin_transaction(); |
| 575 | ttyOutput = 1; |
| 576 | errCnt = rebuild_db(randomizeFlag, 1, doClustering); |
| 577 | reconstruct_private_table(); |
| 578 | db_multi_exec( |
| 579 | "REPLACE INTO config(name,value,mtime) VALUES('content-schema','%s',now());" |
| 580 | "REPLACE INTO config(name,value,mtime) VALUES('aux-schema','%s',now());", |
| 581 | CONTENT_SCHEMA, AUX_SCHEMA |
| 582 | ); |
| @@ -881,25 +903,11 @@ | |
| 903 | fossil_print("Reading files from directory \"%s\"...\n", g.argv[3]); |
| 904 | recon_read_dir(g.argv[3]); |
| 905 | fossil_print("\nBuilding the Fossil repository...\n"); |
| 906 | |
| 907 | rebuild_db(0, 1, 1); |
| 908 | reconstruct_private_table(); |
| 909 | |
| 910 | /* Skip the verify_before_commit() step on a reconstruct. Most artifacts |
| 911 | ** will have been changed and verification therefore takes a really, really |
| 912 | ** long time. |
| 913 | */ |
| 914 |
-3
| --- src/report.c | ||
| +++ src/report.c | ||
| @@ -19,13 +19,10 @@ | ||
| 19 | 19 | */ |
| 20 | 20 | #include "config.h" |
| 21 | 21 | #include <time.h> |
| 22 | 22 | #include "report.h" |
| 23 | 23 | #include <assert.h> |
| 24 | -#ifdef FOSSIL_ENABLE_JSON | |
| 25 | -# include "cson_amalgamation.h" | |
| 26 | -#endif | |
| 27 | 24 | |
| 28 | 25 | /* Forward references to static routines */ |
| 29 | 26 | static void report_format_hints(void); |
| 30 | 27 | |
| 31 | 28 | /* |
| 32 | 29 |
| --- src/report.c | |
| +++ src/report.c | |
| @@ -19,13 +19,10 @@ | |
| 19 | */ |
| 20 | #include "config.h" |
| 21 | #include <time.h> |
| 22 | #include "report.h" |
| 23 | #include <assert.h> |
| 24 | #ifdef FOSSIL_ENABLE_JSON |
| 25 | # include "cson_amalgamation.h" |
| 26 | #endif |
| 27 | |
| 28 | /* Forward references to static routines */ |
| 29 | static void report_format_hints(void); |
| 30 | |
| 31 | /* |
| 32 |
| --- src/report.c | |
| +++ src/report.c | |
| @@ -19,13 +19,10 @@ | |
| 19 | */ |
| 20 | #include "config.h" |
| 21 | #include <time.h> |
| 22 | #include "report.h" |
| 23 | #include <assert.h> |
| 24 | |
| 25 | /* Forward references to static routines */ |
| 26 | static void report_format_hints(void); |
| 27 | |
| 28 | /* |
| 29 |
-3
| --- src/timeline.c | ||
| +++ src/timeline.c | ||
| @@ -20,13 +20,10 @@ | ||
| 20 | 20 | */ |
| 21 | 21 | #include <string.h> |
| 22 | 22 | #include <time.h> |
| 23 | 23 | #include "config.h" |
| 24 | 24 | #include "timeline.h" |
| 25 | -#ifdef FOSSIL_ENABLE_JSON | |
| 26 | -# include "cson_amalgamation.h" | |
| 27 | -#endif | |
| 28 | 25 | |
| 29 | 26 | /* |
| 30 | 27 | ** Shorten a UUID so that is the minimum length needed to contain |
| 31 | 28 | ** at least one digit in the range 'a'..'f'. The minimum length is 10. |
| 32 | 29 | */ |
| 33 | 30 |
| --- src/timeline.c | |
| +++ src/timeline.c | |
| @@ -20,13 +20,10 @@ | |
| 20 | */ |
| 21 | #include <string.h> |
| 22 | #include <time.h> |
| 23 | #include "config.h" |
| 24 | #include "timeline.h" |
| 25 | #ifdef FOSSIL_ENABLE_JSON |
| 26 | # include "cson_amalgamation.h" |
| 27 | #endif |
| 28 | |
| 29 | /* |
| 30 | ** Shorten a UUID so that is the minimum length needed to contain |
| 31 | ** at least one digit in the range 'a'..'f'. The minimum length is 10. |
| 32 | */ |
| 33 |
| --- src/timeline.c | |
| +++ src/timeline.c | |
| @@ -20,13 +20,10 @@ | |
| 20 | */ |
| 21 | #include <string.h> |
| 22 | #include <time.h> |
| 23 | #include "config.h" |
| 24 | #include "timeline.h" |
| 25 | |
| 26 | /* |
| 27 | ** Shorten a UUID so that is the minimum length needed to contain |
| 28 | ** at least one digit in the range 'a'..'f'. The minimum length is 10. |
| 29 | */ |
| 30 |
-3
| --- src/timeline.c | ||
| +++ src/timeline.c | ||
| @@ -20,13 +20,10 @@ | ||
| 20 | 20 | */ |
| 21 | 21 | #include <string.h> |
| 22 | 22 | #include <time.h> |
| 23 | 23 | #include "config.h" |
| 24 | 24 | #include "timeline.h" |
| 25 | -#ifdef FOSSIL_ENABLE_JSON | |
| 26 | -# include "cson_amalgamation.h" | |
| 27 | -#endif | |
| 28 | 25 | |
| 29 | 26 | /* |
| 30 | 27 | ** Shorten a UUID so that is the minimum length needed to contain |
| 31 | 28 | ** at least one digit in the range 'a'..'f'. The minimum length is 10. |
| 32 | 29 | */ |
| 33 | 30 |
| --- src/timeline.c | |
| +++ src/timeline.c | |
| @@ -20,13 +20,10 @@ | |
| 20 | */ |
| 21 | #include <string.h> |
| 22 | #include <time.h> |
| 23 | #include "config.h" |
| 24 | #include "timeline.h" |
| 25 | #ifdef FOSSIL_ENABLE_JSON |
| 26 | # include "cson_amalgamation.h" |
| 27 | #endif |
| 28 | |
| 29 | /* |
| 30 | ** Shorten a UUID so that is the minimum length needed to contain |
| 31 | ** at least one digit in the range 'a'..'f'. The minimum length is 10. |
| 32 | */ |
| 33 |
| --- src/timeline.c | |
| +++ src/timeline.c | |
| @@ -20,13 +20,10 @@ | |
| 20 | */ |
| 21 | #include <string.h> |
| 22 | #include <time.h> |
| 23 | #include "config.h" |
| 24 | #include "timeline.h" |
| 25 | |
| 26 | /* |
| 27 | ** Shorten a UUID so that is the minimum length needed to contain |
| 28 | ** at least one digit in the range 'a'..'f'. The minimum length is 10. |
| 29 | */ |
| 30 |
+1
-1
| --- src/update.c | ||
| +++ src/update.c | ||
| @@ -474,11 +474,11 @@ | ||
| 474 | 474 | if( nConflict ){ |
| 475 | 475 | if( internalUpdate ){ |
| 476 | 476 | internalConflictCnt = nConflict; |
| 477 | 477 | nConflict = 0; |
| 478 | 478 | }else{ |
| 479 | - fossil_print("WARNING: %d merge conflicts", nConflict); | |
| 479 | + fossil_warning("WARNING: %d merge conflicts", nConflict); | |
| 480 | 480 | } |
| 481 | 481 | } |
| 482 | 482 | if( nOverwrite ){ |
| 483 | 483 | fossil_warning("WARNING: %d unmanaged files were overwritten", |
| 484 | 484 | nOverwrite); |
| 485 | 485 |
| --- src/update.c | |
| +++ src/update.c | |
| @@ -474,11 +474,11 @@ | |
| 474 | if( nConflict ){ |
| 475 | if( internalUpdate ){ |
| 476 | internalConflictCnt = nConflict; |
| 477 | nConflict = 0; |
| 478 | }else{ |
| 479 | fossil_print("WARNING: %d merge conflicts", nConflict); |
| 480 | } |
| 481 | } |
| 482 | if( nOverwrite ){ |
| 483 | fossil_warning("WARNING: %d unmanaged files were overwritten", |
| 484 | nOverwrite); |
| 485 |
| --- src/update.c | |
| +++ src/update.c | |
| @@ -474,11 +474,11 @@ | |
| 474 | if( nConflict ){ |
| 475 | if( internalUpdate ){ |
| 476 | internalConflictCnt = nConflict; |
| 477 | nConflict = 0; |
| 478 | }else{ |
| 479 | fossil_warning("WARNING: %d merge conflicts", nConflict); |
| 480 | } |
| 481 | } |
| 482 | if( nOverwrite ){ |
| 483 | fossil_warning("WARNING: %d unmanaged files were overwritten", |
| 484 | nOverwrite); |
| 485 |
+5
-1
| --- win/Makefile.mingw | ||
| +++ win/Makefile.mingw | ||
| @@ -24,10 +24,14 @@ | ||
| 24 | 24 | # will run on the platform that is doing the build. This is used |
| 25 | 25 | # to compile code-generator programs as part of the build process. |
| 26 | 26 | # See TCC below for the C compiler for building the finished binary. |
| 27 | 27 | # |
| 28 | 28 | BCC = gcc |
| 29 | + | |
| 30 | +#### Enable JSON (http://www.json.org) support using "cson" | |
| 31 | +# | |
| 32 | +# FOSSIL_ENABLE_JSON = 1 | |
| 29 | 33 | |
| 30 | 34 | #### Enable HTTPS support via OpenSSL (links to libssl and libcrypto) |
| 31 | 35 | # |
| 32 | 36 | # FOSSIL_ENABLE_SSL = 1 |
| 33 | 37 | |
| @@ -118,11 +122,11 @@ | ||
| 118 | 122 | TCC += -DFOSSIL_ENABLE_TCL=1 -DSTATIC_BUILD |
| 119 | 123 | endif |
| 120 | 124 | |
| 121 | 125 | # With JSON support |
| 122 | 126 | ifdef FOSSIL_ENABLE_JSON |
| 123 | -TCC += -DFOSSIL_ENABLE_JSON | |
| 127 | +TCC += -DFOSSIL_ENABLE_JSON=1 | |
| 124 | 128 | endif |
| 125 | 129 | |
| 126 | 130 | #### Extra arguments for linking the finished binary. Fossil needs |
| 127 | 131 | # to link against the Z-Lib compression library. There are no |
| 128 | 132 | # other mandatory dependencies. We add the -static option here |
| 129 | 133 |
| --- win/Makefile.mingw | |
| +++ win/Makefile.mingw | |
| @@ -24,10 +24,14 @@ | |
| 24 | # will run on the platform that is doing the build. This is used |
| 25 | # to compile code-generator programs as part of the build process. |
| 26 | # See TCC below for the C compiler for building the finished binary. |
| 27 | # |
| 28 | BCC = gcc |
| 29 | |
| 30 | #### Enable HTTPS support via OpenSSL (links to libssl and libcrypto) |
| 31 | # |
| 32 | # FOSSIL_ENABLE_SSL = 1 |
| 33 | |
| @@ -118,11 +122,11 @@ | |
| 118 | TCC += -DFOSSIL_ENABLE_TCL=1 -DSTATIC_BUILD |
| 119 | endif |
| 120 | |
| 121 | # With JSON support |
| 122 | ifdef FOSSIL_ENABLE_JSON |
| 123 | TCC += -DFOSSIL_ENABLE_JSON |
| 124 | endif |
| 125 | |
| 126 | #### Extra arguments for linking the finished binary. Fossil needs |
| 127 | # to link against the Z-Lib compression library. There are no |
| 128 | # other mandatory dependencies. We add the -static option here |
| 129 |
| --- win/Makefile.mingw | |
| +++ win/Makefile.mingw | |
| @@ -24,10 +24,14 @@ | |
| 24 | # will run on the platform that is doing the build. This is used |
| 25 | # to compile code-generator programs as part of the build process. |
| 26 | # See TCC below for the C compiler for building the finished binary. |
| 27 | # |
| 28 | BCC = gcc |
| 29 | |
| 30 | #### Enable JSON (http://www.json.org) support using "cson" |
| 31 | # |
| 32 | # FOSSIL_ENABLE_JSON = 1 |
| 33 | |
| 34 | #### Enable HTTPS support via OpenSSL (links to libssl and libcrypto) |
| 35 | # |
| 36 | # FOSSIL_ENABLE_SSL = 1 |
| 37 | |
| @@ -118,11 +122,11 @@ | |
| 122 | TCC += -DFOSSIL_ENABLE_TCL=1 -DSTATIC_BUILD |
| 123 | endif |
| 124 | |
| 125 | # With JSON support |
| 126 | ifdef FOSSIL_ENABLE_JSON |
| 127 | TCC += -DFOSSIL_ENABLE_JSON=1 |
| 128 | endif |
| 129 | |
| 130 | #### Extra arguments for linking the finished binary. Fossil needs |
| 131 | # to link against the Z-Lib compression library. There are no |
| 132 | # other mandatory dependencies. We add the -static option here |
| 133 |
+21
-2
| --- win/Makefile.mingw.mistachkin | ||
| +++ win/Makefile.mingw.mistachkin | ||
| @@ -24,10 +24,14 @@ | ||
| 24 | 24 | # will run on the platform that is doing the build. This is used |
| 25 | 25 | # to compile code-generator programs as part of the build process. |
| 26 | 26 | # See TCC below for the C compiler for building the finished binary. |
| 27 | 27 | # |
| 28 | 28 | BCC = gcc |
| 29 | + | |
| 30 | +#### Enable JSON (http://www.json.org) support using "cson" | |
| 31 | +# | |
| 32 | +FOSSIL_ENABLE_JSON = 1 | |
| 29 | 33 | |
| 30 | 34 | #### Enable HTTPS support via OpenSSL (links to libssl and libcrypto) |
| 31 | 35 | # |
| 32 | 36 | FOSSIL_ENABLE_SSL = 1 |
| 33 | 37 | |
| @@ -115,10 +119,15 @@ | ||
| 115 | 119 | |
| 116 | 120 | # With Tcl support (statically linked) |
| 117 | 121 | ifdef FOSSIL_ENABLE_TCL |
| 118 | 122 | TCC += -DFOSSIL_ENABLE_TCL=1 -DSTATIC_BUILD |
| 119 | 123 | endif |
| 124 | + | |
| 125 | +# With JSON support | |
| 126 | +ifdef FOSSIL_ENABLE_JSON | |
| 127 | +TCC += -DFOSSIL_ENABLE_JSON=1 | |
| 128 | +endif | |
| 120 | 129 | |
| 121 | 130 | #### Extra arguments for linking the finished binary. Fossil needs |
| 122 | 131 | # to link against the Z-Lib compression library. There are no |
| 123 | 132 | # other mandatory dependencies. We add the -static option here |
| 124 | 133 | # so that we can build a static executable that will run in a |
| @@ -204,10 +213,11 @@ | ||
| 204 | 213 | $(SRCDIR)/import.c \ |
| 205 | 214 | $(SRCDIR)/info.c \ |
| 206 | 215 | $(SRCDIR)/json.c \ |
| 207 | 216 | $(SRCDIR)/json_artifact.c \ |
| 208 | 217 | $(SRCDIR)/json_branch.c \ |
| 218 | + $(SRCDIR)/json_config.c \ | |
| 209 | 219 | $(SRCDIR)/json_diff.c \ |
| 210 | 220 | $(SRCDIR)/json_login.c \ |
| 211 | 221 | $(SRCDIR)/json_query.c \ |
| 212 | 222 | $(SRCDIR)/json_report.c \ |
| 213 | 223 | $(SRCDIR)/json_tag.c \ |
| @@ -300,10 +310,11 @@ | ||
| 300 | 310 | $(OBJDIR)/import_.c \ |
| 301 | 311 | $(OBJDIR)/info_.c \ |
| 302 | 312 | $(OBJDIR)/json_.c \ |
| 303 | 313 | $(OBJDIR)/json_artifact_.c \ |
| 304 | 314 | $(OBJDIR)/json_branch_.c \ |
| 315 | + $(OBJDIR)/json_config_.c \ | |
| 305 | 316 | $(OBJDIR)/json_diff_.c \ |
| 306 | 317 | $(OBJDIR)/json_login_.c \ |
| 307 | 318 | $(OBJDIR)/json_query_.c \ |
| 308 | 319 | $(OBJDIR)/json_report_.c \ |
| 309 | 320 | $(OBJDIR)/json_tag_.c \ |
| @@ -396,10 +407,11 @@ | ||
| 396 | 407 | $(OBJDIR)/import.o \ |
| 397 | 408 | $(OBJDIR)/info.o \ |
| 398 | 409 | $(OBJDIR)/json.o \ |
| 399 | 410 | $(OBJDIR)/json_artifact.o \ |
| 400 | 411 | $(OBJDIR)/json_branch.o \ |
| 412 | + $(OBJDIR)/json_config.o \ | |
| 401 | 413 | $(OBJDIR)/json_diff.o \ |
| 402 | 414 | $(OBJDIR)/json_login.o \ |
| 403 | 415 | $(OBJDIR)/json_query.o \ |
| 404 | 416 | $(OBJDIR)/json_report.o \ |
| 405 | 417 | $(OBJDIR)/json_tag.o \ |
| @@ -519,11 +531,11 @@ | ||
| 519 | 531 | |
| 520 | 532 | |
| 521 | 533 | $(OBJDIR)/page_index.h: $(TRANS_SRC) $(OBJDIR)/mkindex |
| 522 | 534 | $(MKINDEX) $(TRANS_SRC) >$@ |
| 523 | 535 | $(OBJDIR)/headers: $(OBJDIR)/page_index.h $(OBJDIR)/makeheaders $(OBJDIR)/VERSION.h |
| 524 | - $(MAKEHEADERS) $(OBJDIR)/add_.c:$(OBJDIR)/add.h $(OBJDIR)/allrepo_.c:$(OBJDIR)/allrepo.h $(OBJDIR)/attach_.c:$(OBJDIR)/attach.h $(OBJDIR)/bag_.c:$(OBJDIR)/bag.h $(OBJDIR)/bisect_.c:$(OBJDIR)/bisect.h $(OBJDIR)/blob_.c:$(OBJDIR)/blob.h $(OBJDIR)/branch_.c:$(OBJDIR)/branch.h $(OBJDIR)/browse_.c:$(OBJDIR)/browse.h $(OBJDIR)/captcha_.c:$(OBJDIR)/captcha.h $(OBJDIR)/cgi_.c:$(OBJDIR)/cgi.h $(OBJDIR)/checkin_.c:$(OBJDIR)/checkin.h $(OBJDIR)/checkout_.c:$(OBJDIR)/checkout.h $(OBJDIR)/clearsign_.c:$(OBJDIR)/clearsign.h $(OBJDIR)/clone_.c:$(OBJDIR)/clone.h $(OBJDIR)/comformat_.c:$(OBJDIR)/comformat.h $(OBJDIR)/configure_.c:$(OBJDIR)/configure.h $(OBJDIR)/content_.c:$(OBJDIR)/content.h $(OBJDIR)/db_.c:$(OBJDIR)/db.h $(OBJDIR)/delta_.c:$(OBJDIR)/delta.h $(OBJDIR)/deltacmd_.c:$(OBJDIR)/deltacmd.h $(OBJDIR)/descendants_.c:$(OBJDIR)/descendants.h $(OBJDIR)/diff_.c:$(OBJDIR)/diff.h $(OBJDIR)/diffcmd_.c:$(OBJDIR)/diffcmd.h $(OBJDIR)/doc_.c:$(OBJDIR)/doc.h $(OBJDIR)/encode_.c:$(OBJDIR)/encode.h $(OBJDIR)/event_.c:$(OBJDIR)/event.h $(OBJDIR)/export_.c:$(OBJDIR)/export.h $(OBJDIR)/file_.c:$(OBJDIR)/file.h $(OBJDIR)/finfo_.c:$(OBJDIR)/finfo.h $(OBJDIR)/glob_.c:$(OBJDIR)/glob.h $(OBJDIR)/graph_.c:$(OBJDIR)/graph.h $(OBJDIR)/gzip_.c:$(OBJDIR)/gzip.h $(OBJDIR)/http_.c:$(OBJDIR)/http.h $(OBJDIR)/http_socket_.c:$(OBJDIR)/http_socket.h $(OBJDIR)/http_ssl_.c:$(OBJDIR)/http_ssl.h $(OBJDIR)/http_transport_.c:$(OBJDIR)/http_transport.h $(OBJDIR)/import_.c:$(OBJDIR)/import.h $(OBJDIR)/info_.c:$(OBJDIR)/info.h $(OBJDIR)/json_.c:$(OBJDIR)/json.h $(OBJDIR)/json_artifact_.c:$(OBJDIR)/json_artifact.h $(OBJDIR)/json_branch_.c:$(OBJDIR)/json_branch.h $(OBJDIR)/json_diff_.c:$(OBJDIR)/json_diff.h $(OBJDIR)/json_login_.c:$(OBJDIR)/json_login.h $(OBJDIR)/json_query_.c:$(OBJDIR)/json_query.h $(OBJDIR)/json_report_.c:$(OBJDIR)/json_report.h $(OBJDIR)/json_tag_.c:$(OBJDIR)/json_tag.h $(OBJDIR)/json_timeline_.c:$(OBJDIR)/json_timeline.h $(OBJDIR)/json_user_.c:$(OBJDIR)/json_user.h $(OBJDIR)/json_wiki_.c:$(OBJDIR)/json_wiki.h $(OBJDIR)/leaf_.c:$(OBJDIR)/leaf.h $(OBJDIR)/login_.c:$(OBJDIR)/login.h $(OBJDIR)/main_.c:$(OBJDIR)/main.h $(OBJDIR)/manifest_.c:$(OBJDIR)/manifest.h $(OBJDIR)/md5_.c:$(OBJDIR)/md5.h $(OBJDIR)/merge_.c:$(OBJDIR)/merge.h $(OBJDIR)/merge3_.c:$(OBJDIR)/merge3.h $(OBJDIR)/name_.c:$(OBJDIR)/name.h $(OBJDIR)/path_.c:$(OBJDIR)/path.h $(OBJDIR)/pivot_.c:$(OBJDIR)/pivot.h $(OBJDIR)/popen_.c:$(OBJDIR)/popen.h $(OBJDIR)/pqueue_.c:$(OBJDIR)/pqueue.h $(OBJDIR)/printf_.c:$(OBJDIR)/printf.h $(OBJDIR)/rebuild_.c:$(OBJDIR)/rebuild.h $(OBJDIR)/report_.c:$(OBJDIR)/report.h $(OBJDIR)/rss_.c:$(OBJDIR)/rss.h $(OBJDIR)/schema_.c:$(OBJDIR)/schema.h $(OBJDIR)/search_.c:$(OBJDIR)/search.h $(OBJDIR)/setup_.c:$(OBJDIR)/setup.h $(OBJDIR)/sha1_.c:$(OBJDIR)/sha1.h $(OBJDIR)/shun_.c:$(OBJDIR)/shun.h $(OBJDIR)/skins_.c:$(OBJDIR)/skins.h $(OBJDIR)/sqlcmd_.c:$(OBJDIR)/sqlcmd.h $(OBJDIR)/stash_.c:$(OBJDIR)/stash.h $(OBJDIR)/stat_.c:$(OBJDIR)/stat.h $(OBJDIR)/style_.c:$(OBJDIR)/style.h $(OBJDIR)/sync_.c:$(OBJDIR)/sync.h $(OBJDIR)/tag_.c:$(OBJDIR)/tag.h $(OBJDIR)/tar_.c:$(OBJDIR)/tar.h $(OBJDIR)/th_main_.c:$(OBJDIR)/th_main.h $(OBJDIR)/timeline_.c:$(OBJDIR)/timeline.h $(OBJDIR)/tkt_.c:$(OBJDIR)/tkt.h $(OBJDIR)/tktsetup_.c:$(OBJDIR)/tktsetup.h $(OBJDIR)/undo_.c:$(OBJDIR)/undo.h $(OBJDIR)/update_.c:$(OBJDIR)/update.h $(OBJDIR)/url_.c:$(OBJDIR)/url.h $(OBJDIR)/user_.c:$(OBJDIR)/user.h $(OBJDIR)/verify_.c:$(OBJDIR)/verify.h $(OBJDIR)/vfile_.c:$(OBJDIR)/vfile.h $(OBJDIR)/wiki_.c:$(OBJDIR)/wiki.h $(OBJDIR)/wikiformat_.c:$(OBJDIR)/wikiformat.h $(OBJDIR)/winhttp_.c:$(OBJDIR)/winhttp.h $(OBJDIR)/xfer_.c:$(OBJDIR)/xfer.h $(OBJDIR)/xfersetup_.c:$(OBJDIR)/xfersetup.h $(OBJDIR)/zip_.c:$(OBJDIR)/zip.h $(SRCDIR)/sqlite3.h $(SRCDIR)/th.h $(OBJDIR)/VERSION.h | |
| 536 | + $(MAKEHEADERS) $(OBJDIR)/add_.c:$(OBJDIR)/add.h $(OBJDIR)/allrepo_.c:$(OBJDIR)/allrepo.h $(OBJDIR)/attach_.c:$(OBJDIR)/attach.h $(OBJDIR)/bag_.c:$(OBJDIR)/bag.h $(OBJDIR)/bisect_.c:$(OBJDIR)/bisect.h $(OBJDIR)/blob_.c:$(OBJDIR)/blob.h $(OBJDIR)/branch_.c:$(OBJDIR)/branch.h $(OBJDIR)/browse_.c:$(OBJDIR)/browse.h $(OBJDIR)/captcha_.c:$(OBJDIR)/captcha.h $(OBJDIR)/cgi_.c:$(OBJDIR)/cgi.h $(OBJDIR)/checkin_.c:$(OBJDIR)/checkin.h $(OBJDIR)/checkout_.c:$(OBJDIR)/checkout.h $(OBJDIR)/clearsign_.c:$(OBJDIR)/clearsign.h $(OBJDIR)/clone_.c:$(OBJDIR)/clone.h $(OBJDIR)/comformat_.c:$(OBJDIR)/comformat.h $(OBJDIR)/configure_.c:$(OBJDIR)/configure.h $(OBJDIR)/content_.c:$(OBJDIR)/content.h $(OBJDIR)/db_.c:$(OBJDIR)/db.h $(OBJDIR)/delta_.c:$(OBJDIR)/delta.h $(OBJDIR)/deltacmd_.c:$(OBJDIR)/deltacmd.h $(OBJDIR)/descendants_.c:$(OBJDIR)/descendants.h $(OBJDIR)/diff_.c:$(OBJDIR)/diff.h $(OBJDIR)/diffcmd_.c:$(OBJDIR)/diffcmd.h $(OBJDIR)/doc_.c:$(OBJDIR)/doc.h $(OBJDIR)/encode_.c:$(OBJDIR)/encode.h $(OBJDIR)/event_.c:$(OBJDIR)/event.h $(OBJDIR)/export_.c:$(OBJDIR)/export.h $(OBJDIR)/file_.c:$(OBJDIR)/file.h $(OBJDIR)/finfo_.c:$(OBJDIR)/finfo.h $(OBJDIR)/glob_.c:$(OBJDIR)/glob.h $(OBJDIR)/graph_.c:$(OBJDIR)/graph.h $(OBJDIR)/gzip_.c:$(OBJDIR)/gzip.h $(OBJDIR)/http_.c:$(OBJDIR)/http.h $(OBJDIR)/http_socket_.c:$(OBJDIR)/http_socket.h $(OBJDIR)/http_ssl_.c:$(OBJDIR)/http_ssl.h $(OBJDIR)/http_transport_.c:$(OBJDIR)/http_transport.h $(OBJDIR)/import_.c:$(OBJDIR)/import.h $(OBJDIR)/info_.c:$(OBJDIR)/info.h $(OBJDIR)/json_.c:$(OBJDIR)/json.h $(OBJDIR)/json_artifact_.c:$(OBJDIR)/json_artifact.h $(OBJDIR)/json_branch_.c:$(OBJDIR)/json_branch.h $(OBJDIR)/json_config_.c:$(OBJDIR)/json_config.h $(OBJDIR)/json_diff_.c:$(OBJDIR)/json_diff.h $(OBJDIR)/json_login_.c:$(OBJDIR)/json_login.h $(OBJDIR)/json_query_.c:$(OBJDIR)/json_query.h $(OBJDIR)/json_report_.c:$(OBJDIR)/json_report.h $(OBJDIR)/json_tag_.c:$(OBJDIR)/json_tag.h $(OBJDIR)/json_timeline_.c:$(OBJDIR)/json_timeline.h $(OBJDIR)/json_user_.c:$(OBJDIR)/json_user.h $(OBJDIR)/json_wiki_.c:$(OBJDIR)/json_wiki.h $(OBJDIR)/leaf_.c:$(OBJDIR)/leaf.h $(OBJDIR)/login_.c:$(OBJDIR)/login.h $(OBJDIR)/main_.c:$(OBJDIR)/main.h $(OBJDIR)/manifest_.c:$(OBJDIR)/manifest.h $(OBJDIR)/md5_.c:$(OBJDIR)/md5.h $(OBJDIR)/merge_.c:$(OBJDIR)/merge.h $(OBJDIR)/merge3_.c:$(OBJDIR)/merge3.h $(OBJDIR)/name_.c:$(OBJDIR)/name.h $(OBJDIR)/path_.c:$(OBJDIR)/path.h $(OBJDIR)/pivot_.c:$(OBJDIR)/pivot.h $(OBJDIR)/popen_.c:$(OBJDIR)/popen.h $(OBJDIR)/pqueue_.c:$(OBJDIR)/pqueue.h $(OBJDIR)/printf_.c:$(OBJDIR)/printf.h $(OBJDIR)/rebuild_.c:$(OBJDIR)/rebuild.h $(OBJDIR)/report_.c:$(OBJDIR)/report.h $(OBJDIR)/rss_.c:$(OBJDIR)/rss.h $(OBJDIR)/schema_.c:$(OBJDIR)/schema.h $(OBJDIR)/search_.c:$(OBJDIR)/search.h $(OBJDIR)/setup_.c:$(OBJDIR)/setup.h $(OBJDIR)/sha1_.c:$(OBJDIR)/sha1.h $(OBJDIR)/shun_.c:$(OBJDIR)/shun.h $(OBJDIR)/skins_.c:$(OBJDIR)/skins.h $(OBJDIR)/sqlcmd_.c:$(OBJDIR)/sqlcmd.h $(OBJDIR)/stash_.c:$(OBJDIR)/stash.h $(OBJDIR)/stat_.c:$(OBJDIR)/stat.h $(OBJDIR)/style_.c:$(OBJDIR)/style.h $(OBJDIR)/sync_.c:$(OBJDIR)/sync.h $(OBJDIR)/tag_.c:$(OBJDIR)/tag.h $(OBJDIR)/tar_.c:$(OBJDIR)/tar.h $(OBJDIR)/th_main_.c:$(OBJDIR)/th_main.h $(OBJDIR)/timeline_.c:$(OBJDIR)/timeline.h $(OBJDIR)/tkt_.c:$(OBJDIR)/tkt.h $(OBJDIR)/tktsetup_.c:$(OBJDIR)/tktsetup.h $(OBJDIR)/undo_.c:$(OBJDIR)/undo.h $(OBJDIR)/update_.c:$(OBJDIR)/update.h $(OBJDIR)/url_.c:$(OBJDIR)/url.h $(OBJDIR)/user_.c:$(OBJDIR)/user.h $(OBJDIR)/verify_.c:$(OBJDIR)/verify.h $(OBJDIR)/vfile_.c:$(OBJDIR)/vfile.h $(OBJDIR)/wiki_.c:$(OBJDIR)/wiki.h $(OBJDIR)/wikiformat_.c:$(OBJDIR)/wikiformat.h $(OBJDIR)/winhttp_.c:$(OBJDIR)/winhttp.h $(OBJDIR)/xfer_.c:$(OBJDIR)/xfer.h $(OBJDIR)/xfersetup_.c:$(OBJDIR)/xfersetup.h $(OBJDIR)/zip_.c:$(OBJDIR)/zip.h $(SRCDIR)/sqlite3.h $(SRCDIR)/th.h $(OBJDIR)/VERSION.h | |
| 525 | 537 | echo Done >$(OBJDIR)/headers |
| 526 | 538 | |
| 527 | 539 | $(OBJDIR)/headers: Makefile |
| 528 | 540 | Makefile: |
| 529 | 541 | $(OBJDIR)/add_.c: $(SRCDIR)/add.c $(OBJDIR)/translate |
| @@ -811,10 +823,17 @@ | ||
| 811 | 823 | |
| 812 | 824 | $(OBJDIR)/json_branch.o: $(OBJDIR)/json_branch_.c $(OBJDIR)/json_branch.h $(SRCDIR)/config.h |
| 813 | 825 | $(XTCC) -o $(OBJDIR)/json_branch.o -c $(OBJDIR)/json_branch_.c |
| 814 | 826 | |
| 815 | 827 | json_branch.h: $(OBJDIR)/headers |
| 828 | +$(OBJDIR)/json_config_.c: $(SRCDIR)/json_config.c $(OBJDIR)/translate | |
| 829 | + $(TRANSLATE) $(SRCDIR)/json_config.c >$(OBJDIR)/json_config_.c | |
| 830 | + | |
| 831 | +$(OBJDIR)/json_config.o: $(OBJDIR)/json_config_.c $(OBJDIR)/json_config.h $(SRCDIR)/config.h | |
| 832 | + $(XTCC) -o $(OBJDIR)/json_config.o -c $(OBJDIR)/json_config_.c | |
| 833 | + | |
| 834 | +json_config.h: $(OBJDIR)/headers | |
| 816 | 835 | $(OBJDIR)/json_diff_.c: $(SRCDIR)/json_diff.c $(OBJDIR)/translate |
| 817 | 836 | $(TRANSLATE) $(SRCDIR)/json_diff.c >$(OBJDIR)/json_diff_.c |
| 818 | 837 | |
| 819 | 838 | $(OBJDIR)/json_diff.o: $(OBJDIR)/json_diff_.c $(OBJDIR)/json_diff.h $(SRCDIR)/config.h |
| 820 | 839 | $(XTCC) -o $(OBJDIR)/json_diff.o -c $(OBJDIR)/json_diff_.c |
| @@ -1188,11 +1207,11 @@ | ||
| 1188 | 1207 | $(XTCC) -DSQLITE_OMIT_LOAD_EXTENSION=1 -DSQLITE_THREADSAFE=0 -DSQLITE_DEFAULT_FILE_FORMAT=4 -DSQLITE_ENABLE_STAT3 -Dlocaltime=fossil_localtime -DSQLITE_ENABLE_LOCKING_STYLE=0 -c $(SRCDIR)/sqlite3.c -o $(OBJDIR)/sqlite3.o |
| 1189 | 1208 | |
| 1190 | 1209 | $(OBJDIR)/cson_amalgamation.o: $(SRCDIR)/cson_amalgamation.c |
| 1191 | 1210 | $(XTCC) -c $(SRCDIR)/cson_amalgamation.c -o $(OBJDIR)/cson_amalgamation.o -DCSON_FOSSIL_MODE |
| 1192 | 1211 | |
| 1193 | -$(OBJDIR)/json.o $(OBJDIR)/json_artifact.o $(OBJDIR)/json_branch.o $(OBJDIR)/json_diff.o $(OBJDIR)/json_login.o $(OBJDIR)/json_query.o $(OBJDIR)/json_report.o $(OBJDIR)/json_tag.o $(OBJDIR)/json_timeline.o $(OBJDIR)/json_user.o $(OBJDIR)/json_wiki.o : $(SRCDIR)/json_detail.h | |
| 1212 | +$(OBJDIR)/json.o $(OBJDIR)/json_artifact.o $(OBJDIR)/json_branch.o $(OBJDIR)/json_config.o $(OBJDIR)/json_diff.o $(OBJDIR)/json_login.o $(OBJDIR)/json_query.o $(OBJDIR)/json_report.o $(OBJDIR)/json_tag.o $(OBJDIR)/json_timeline.o $(OBJDIR)/json_user.o $(OBJDIR)/json_wiki.o : $(SRCDIR)/json_detail.h | |
| 1194 | 1213 | |
| 1195 | 1214 | $(OBJDIR)/shell.o: $(SRCDIR)/shell.c $(SRCDIR)/sqlite3.h |
| 1196 | 1215 | $(XTCC) -Dmain=sqlite3_shell -DSQLITE_OMIT_LOAD_EXTENSION=1 -c $(SRCDIR)/shell.c -o $(OBJDIR)/shell.o |
| 1197 | 1216 | |
| 1198 | 1217 | $(OBJDIR)/th.o: $(SRCDIR)/th.c |
| 1199 | 1218 |
| --- win/Makefile.mingw.mistachkin | |
| +++ win/Makefile.mingw.mistachkin | |
| @@ -24,10 +24,14 @@ | |
| 24 | # will run on the platform that is doing the build. This is used |
| 25 | # to compile code-generator programs as part of the build process. |
| 26 | # See TCC below for the C compiler for building the finished binary. |
| 27 | # |
| 28 | BCC = gcc |
| 29 | |
| 30 | #### Enable HTTPS support via OpenSSL (links to libssl and libcrypto) |
| 31 | # |
| 32 | FOSSIL_ENABLE_SSL = 1 |
| 33 | |
| @@ -115,10 +119,15 @@ | |
| 115 | |
| 116 | # With Tcl support (statically linked) |
| 117 | ifdef FOSSIL_ENABLE_TCL |
| 118 | TCC += -DFOSSIL_ENABLE_TCL=1 -DSTATIC_BUILD |
| 119 | endif |
| 120 | |
| 121 | #### Extra arguments for linking the finished binary. Fossil needs |
| 122 | # to link against the Z-Lib compression library. There are no |
| 123 | # other mandatory dependencies. We add the -static option here |
| 124 | # so that we can build a static executable that will run in a |
| @@ -204,10 +213,11 @@ | |
| 204 | $(SRCDIR)/import.c \ |
| 205 | $(SRCDIR)/info.c \ |
| 206 | $(SRCDIR)/json.c \ |
| 207 | $(SRCDIR)/json_artifact.c \ |
| 208 | $(SRCDIR)/json_branch.c \ |
| 209 | $(SRCDIR)/json_diff.c \ |
| 210 | $(SRCDIR)/json_login.c \ |
| 211 | $(SRCDIR)/json_query.c \ |
| 212 | $(SRCDIR)/json_report.c \ |
| 213 | $(SRCDIR)/json_tag.c \ |
| @@ -300,10 +310,11 @@ | |
| 300 | $(OBJDIR)/import_.c \ |
| 301 | $(OBJDIR)/info_.c \ |
| 302 | $(OBJDIR)/json_.c \ |
| 303 | $(OBJDIR)/json_artifact_.c \ |
| 304 | $(OBJDIR)/json_branch_.c \ |
| 305 | $(OBJDIR)/json_diff_.c \ |
| 306 | $(OBJDIR)/json_login_.c \ |
| 307 | $(OBJDIR)/json_query_.c \ |
| 308 | $(OBJDIR)/json_report_.c \ |
| 309 | $(OBJDIR)/json_tag_.c \ |
| @@ -396,10 +407,11 @@ | |
| 396 | $(OBJDIR)/import.o \ |
| 397 | $(OBJDIR)/info.o \ |
| 398 | $(OBJDIR)/json.o \ |
| 399 | $(OBJDIR)/json_artifact.o \ |
| 400 | $(OBJDIR)/json_branch.o \ |
| 401 | $(OBJDIR)/json_diff.o \ |
| 402 | $(OBJDIR)/json_login.o \ |
| 403 | $(OBJDIR)/json_query.o \ |
| 404 | $(OBJDIR)/json_report.o \ |
| 405 | $(OBJDIR)/json_tag.o \ |
| @@ -519,11 +531,11 @@ | |
| 519 | |
| 520 | |
| 521 | $(OBJDIR)/page_index.h: $(TRANS_SRC) $(OBJDIR)/mkindex |
| 522 | $(MKINDEX) $(TRANS_SRC) >$@ |
| 523 | $(OBJDIR)/headers: $(OBJDIR)/page_index.h $(OBJDIR)/makeheaders $(OBJDIR)/VERSION.h |
| 524 | $(MAKEHEADERS) $(OBJDIR)/add_.c:$(OBJDIR)/add.h $(OBJDIR)/allrepo_.c:$(OBJDIR)/allrepo.h $(OBJDIR)/attach_.c:$(OBJDIR)/attach.h $(OBJDIR)/bag_.c:$(OBJDIR)/bag.h $(OBJDIR)/bisect_.c:$(OBJDIR)/bisect.h $(OBJDIR)/blob_.c:$(OBJDIR)/blob.h $(OBJDIR)/branch_.c:$(OBJDIR)/branch.h $(OBJDIR)/browse_.c:$(OBJDIR)/browse.h $(OBJDIR)/captcha_.c:$(OBJDIR)/captcha.h $(OBJDIR)/cgi_.c:$(OBJDIR)/cgi.h $(OBJDIR)/checkin_.c:$(OBJDIR)/checkin.h $(OBJDIR)/checkout_.c:$(OBJDIR)/checkout.h $(OBJDIR)/clearsign_.c:$(OBJDIR)/clearsign.h $(OBJDIR)/clone_.c:$(OBJDIR)/clone.h $(OBJDIR)/comformat_.c:$(OBJDIR)/comformat.h $(OBJDIR)/configure_.c:$(OBJDIR)/configure.h $(OBJDIR)/content_.c:$(OBJDIR)/content.h $(OBJDIR)/db_.c:$(OBJDIR)/db.h $(OBJDIR)/delta_.c:$(OBJDIR)/delta.h $(OBJDIR)/deltacmd_.c:$(OBJDIR)/deltacmd.h $(OBJDIR)/descendants_.c:$(OBJDIR)/descendants.h $(OBJDIR)/diff_.c:$(OBJDIR)/diff.h $(OBJDIR)/diffcmd_.c:$(OBJDIR)/diffcmd.h $(OBJDIR)/doc_.c:$(OBJDIR)/doc.h $(OBJDIR)/encode_.c:$(OBJDIR)/encode.h $(OBJDIR)/event_.c:$(OBJDIR)/event.h $(OBJDIR)/export_.c:$(OBJDIR)/export.h $(OBJDIR)/file_.c:$(OBJDIR)/file.h $(OBJDIR)/finfo_.c:$(OBJDIR)/finfo.h $(OBJDIR)/glob_.c:$(OBJDIR)/glob.h $(OBJDIR)/graph_.c:$(OBJDIR)/graph.h $(OBJDIR)/gzip_.c:$(OBJDIR)/gzip.h $(OBJDIR)/http_.c:$(OBJDIR)/http.h $(OBJDIR)/http_socket_.c:$(OBJDIR)/http_socket.h $(OBJDIR)/http_ssl_.c:$(OBJDIR)/http_ssl.h $(OBJDIR)/http_transport_.c:$(OBJDIR)/http_transport.h $(OBJDIR)/import_.c:$(OBJDIR)/import.h $(OBJDIR)/info_.c:$(OBJDIR)/info.h $(OBJDIR)/json_.c:$(OBJDIR)/json.h $(OBJDIR)/json_artifact_.c:$(OBJDIR)/json_artifact.h $(OBJDIR)/json_branch_.c:$(OBJDIR)/json_branch.h $(OBJDIR)/json_diff_.c:$(OBJDIR)/json_diff.h $(OBJDIR)/json_login_.c:$(OBJDIR)/json_login.h $(OBJDIR)/json_query_.c:$(OBJDIR)/json_query.h $(OBJDIR)/json_report_.c:$(OBJDIR)/json_report.h $(OBJDIR)/json_tag_.c:$(OBJDIR)/json_tag.h $(OBJDIR)/json_timeline_.c:$(OBJDIR)/json_timeline.h $(OBJDIR)/json_user_.c:$(OBJDIR)/json_user.h $(OBJDIR)/json_wiki_.c:$(OBJDIR)/json_wiki.h $(OBJDIR)/leaf_.c:$(OBJDIR)/leaf.h $(OBJDIR)/login_.c:$(OBJDIR)/login.h $(OBJDIR)/main_.c:$(OBJDIR)/main.h $(OBJDIR)/manifest_.c:$(OBJDIR)/manifest.h $(OBJDIR)/md5_.c:$(OBJDIR)/md5.h $(OBJDIR)/merge_.c:$(OBJDIR)/merge.h $(OBJDIR)/merge3_.c:$(OBJDIR)/merge3.h $(OBJDIR)/name_.c:$(OBJDIR)/name.h $(OBJDIR)/path_.c:$(OBJDIR)/path.h $(OBJDIR)/pivot_.c:$(OBJDIR)/pivot.h $(OBJDIR)/popen_.c:$(OBJDIR)/popen.h $(OBJDIR)/pqueue_.c:$(OBJDIR)/pqueue.h $(OBJDIR)/printf_.c:$(OBJDIR)/printf.h $(OBJDIR)/rebuild_.c:$(OBJDIR)/rebuild.h $(OBJDIR)/report_.c:$(OBJDIR)/report.h $(OBJDIR)/rss_.c:$(OBJDIR)/rss.h $(OBJDIR)/schema_.c:$(OBJDIR)/schema.h $(OBJDIR)/search_.c:$(OBJDIR)/search.h $(OBJDIR)/setup_.c:$(OBJDIR)/setup.h $(OBJDIR)/sha1_.c:$(OBJDIR)/sha1.h $(OBJDIR)/shun_.c:$(OBJDIR)/shun.h $(OBJDIR)/skins_.c:$(OBJDIR)/skins.h $(OBJDIR)/sqlcmd_.c:$(OBJDIR)/sqlcmd.h $(OBJDIR)/stash_.c:$(OBJDIR)/stash.h $(OBJDIR)/stat_.c:$(OBJDIR)/stat.h $(OBJDIR)/style_.c:$(OBJDIR)/style.h $(OBJDIR)/sync_.c:$(OBJDIR)/sync.h $(OBJDIR)/tag_.c:$(OBJDIR)/tag.h $(OBJDIR)/tar_.c:$(OBJDIR)/tar.h $(OBJDIR)/th_main_.c:$(OBJDIR)/th_main.h $(OBJDIR)/timeline_.c:$(OBJDIR)/timeline.h $(OBJDIR)/tkt_.c:$(OBJDIR)/tkt.h $(OBJDIR)/tktsetup_.c:$(OBJDIR)/tktsetup.h $(OBJDIR)/undo_.c:$(OBJDIR)/undo.h $(OBJDIR)/update_.c:$(OBJDIR)/update.h $(OBJDIR)/url_.c:$(OBJDIR)/url.h $(OBJDIR)/user_.c:$(OBJDIR)/user.h $(OBJDIR)/verify_.c:$(OBJDIR)/verify.h $(OBJDIR)/vfile_.c:$(OBJDIR)/vfile.h $(OBJDIR)/wiki_.c:$(OBJDIR)/wiki.h $(OBJDIR)/wikiformat_.c:$(OBJDIR)/wikiformat.h $(OBJDIR)/winhttp_.c:$(OBJDIR)/winhttp.h $(OBJDIR)/xfer_.c:$(OBJDIR)/xfer.h $(OBJDIR)/xfersetup_.c:$(OBJDIR)/xfersetup.h $(OBJDIR)/zip_.c:$(OBJDIR)/zip.h $(SRCDIR)/sqlite3.h $(SRCDIR)/th.h $(OBJDIR)/VERSION.h |
| 525 | echo Done >$(OBJDIR)/headers |
| 526 | |
| 527 | $(OBJDIR)/headers: Makefile |
| 528 | Makefile: |
| 529 | $(OBJDIR)/add_.c: $(SRCDIR)/add.c $(OBJDIR)/translate |
| @@ -811,10 +823,17 @@ | |
| 811 | |
| 812 | $(OBJDIR)/json_branch.o: $(OBJDIR)/json_branch_.c $(OBJDIR)/json_branch.h $(SRCDIR)/config.h |
| 813 | $(XTCC) -o $(OBJDIR)/json_branch.o -c $(OBJDIR)/json_branch_.c |
| 814 | |
| 815 | json_branch.h: $(OBJDIR)/headers |
| 816 | $(OBJDIR)/json_diff_.c: $(SRCDIR)/json_diff.c $(OBJDIR)/translate |
| 817 | $(TRANSLATE) $(SRCDIR)/json_diff.c >$(OBJDIR)/json_diff_.c |
| 818 | |
| 819 | $(OBJDIR)/json_diff.o: $(OBJDIR)/json_diff_.c $(OBJDIR)/json_diff.h $(SRCDIR)/config.h |
| 820 | $(XTCC) -o $(OBJDIR)/json_diff.o -c $(OBJDIR)/json_diff_.c |
| @@ -1188,11 +1207,11 @@ | |
| 1188 | $(XTCC) -DSQLITE_OMIT_LOAD_EXTENSION=1 -DSQLITE_THREADSAFE=0 -DSQLITE_DEFAULT_FILE_FORMAT=4 -DSQLITE_ENABLE_STAT3 -Dlocaltime=fossil_localtime -DSQLITE_ENABLE_LOCKING_STYLE=0 -c $(SRCDIR)/sqlite3.c -o $(OBJDIR)/sqlite3.o |
| 1189 | |
| 1190 | $(OBJDIR)/cson_amalgamation.o: $(SRCDIR)/cson_amalgamation.c |
| 1191 | $(XTCC) -c $(SRCDIR)/cson_amalgamation.c -o $(OBJDIR)/cson_amalgamation.o -DCSON_FOSSIL_MODE |
| 1192 | |
| 1193 | $(OBJDIR)/json.o $(OBJDIR)/json_artifact.o $(OBJDIR)/json_branch.o $(OBJDIR)/json_diff.o $(OBJDIR)/json_login.o $(OBJDIR)/json_query.o $(OBJDIR)/json_report.o $(OBJDIR)/json_tag.o $(OBJDIR)/json_timeline.o $(OBJDIR)/json_user.o $(OBJDIR)/json_wiki.o : $(SRCDIR)/json_detail.h |
| 1194 | |
| 1195 | $(OBJDIR)/shell.o: $(SRCDIR)/shell.c $(SRCDIR)/sqlite3.h |
| 1196 | $(XTCC) -Dmain=sqlite3_shell -DSQLITE_OMIT_LOAD_EXTENSION=1 -c $(SRCDIR)/shell.c -o $(OBJDIR)/shell.o |
| 1197 | |
| 1198 | $(OBJDIR)/th.o: $(SRCDIR)/th.c |
| 1199 |
| --- win/Makefile.mingw.mistachkin | |
| +++ win/Makefile.mingw.mistachkin | |
| @@ -24,10 +24,14 @@ | |
| 24 | # will run on the platform that is doing the build. This is used |
| 25 | # to compile code-generator programs as part of the build process. |
| 26 | # See TCC below for the C compiler for building the finished binary. |
| 27 | # |
| 28 | BCC = gcc |
| 29 | |
| 30 | #### Enable JSON (http://www.json.org) support using "cson" |
| 31 | # |
| 32 | FOSSIL_ENABLE_JSON = 1 |
| 33 | |
| 34 | #### Enable HTTPS support via OpenSSL (links to libssl and libcrypto) |
| 35 | # |
| 36 | FOSSIL_ENABLE_SSL = 1 |
| 37 | |
| @@ -115,10 +119,15 @@ | |
| 119 | |
| 120 | # With Tcl support (statically linked) |
| 121 | ifdef FOSSIL_ENABLE_TCL |
| 122 | TCC += -DFOSSIL_ENABLE_TCL=1 -DSTATIC_BUILD |
| 123 | endif |
| 124 | |
| 125 | # With JSON support |
| 126 | ifdef FOSSIL_ENABLE_JSON |
| 127 | TCC += -DFOSSIL_ENABLE_JSON=1 |
| 128 | endif |
| 129 | |
| 130 | #### Extra arguments for linking the finished binary. Fossil needs |
| 131 | # to link against the Z-Lib compression library. There are no |
| 132 | # other mandatory dependencies. We add the -static option here |
| 133 | # so that we can build a static executable that will run in a |
| @@ -204,10 +213,11 @@ | |
| 213 | $(SRCDIR)/import.c \ |
| 214 | $(SRCDIR)/info.c \ |
| 215 | $(SRCDIR)/json.c \ |
| 216 | $(SRCDIR)/json_artifact.c \ |
| 217 | $(SRCDIR)/json_branch.c \ |
| 218 | $(SRCDIR)/json_config.c \ |
| 219 | $(SRCDIR)/json_diff.c \ |
| 220 | $(SRCDIR)/json_login.c \ |
| 221 | $(SRCDIR)/json_query.c \ |
| 222 | $(SRCDIR)/json_report.c \ |
| 223 | $(SRCDIR)/json_tag.c \ |
| @@ -300,10 +310,11 @@ | |
| 310 | $(OBJDIR)/import_.c \ |
| 311 | $(OBJDIR)/info_.c \ |
| 312 | $(OBJDIR)/json_.c \ |
| 313 | $(OBJDIR)/json_artifact_.c \ |
| 314 | $(OBJDIR)/json_branch_.c \ |
| 315 | $(OBJDIR)/json_config_.c \ |
| 316 | $(OBJDIR)/json_diff_.c \ |
| 317 | $(OBJDIR)/json_login_.c \ |
| 318 | $(OBJDIR)/json_query_.c \ |
| 319 | $(OBJDIR)/json_report_.c \ |
| 320 | $(OBJDIR)/json_tag_.c \ |
| @@ -396,10 +407,11 @@ | |
| 407 | $(OBJDIR)/import.o \ |
| 408 | $(OBJDIR)/info.o \ |
| 409 | $(OBJDIR)/json.o \ |
| 410 | $(OBJDIR)/json_artifact.o \ |
| 411 | $(OBJDIR)/json_branch.o \ |
| 412 | $(OBJDIR)/json_config.o \ |
| 413 | $(OBJDIR)/json_diff.o \ |
| 414 | $(OBJDIR)/json_login.o \ |
| 415 | $(OBJDIR)/json_query.o \ |
| 416 | $(OBJDIR)/json_report.o \ |
| 417 | $(OBJDIR)/json_tag.o \ |
| @@ -519,11 +531,11 @@ | |
| 531 | |
| 532 | |
| 533 | $(OBJDIR)/page_index.h: $(TRANS_SRC) $(OBJDIR)/mkindex |
| 534 | $(MKINDEX) $(TRANS_SRC) >$@ |
| 535 | $(OBJDIR)/headers: $(OBJDIR)/page_index.h $(OBJDIR)/makeheaders $(OBJDIR)/VERSION.h |
| 536 | $(MAKEHEADERS) $(OBJDIR)/add_.c:$(OBJDIR)/add.h $(OBJDIR)/allrepo_.c:$(OBJDIR)/allrepo.h $(OBJDIR)/attach_.c:$(OBJDIR)/attach.h $(OBJDIR)/bag_.c:$(OBJDIR)/bag.h $(OBJDIR)/bisect_.c:$(OBJDIR)/bisect.h $(OBJDIR)/blob_.c:$(OBJDIR)/blob.h $(OBJDIR)/branch_.c:$(OBJDIR)/branch.h $(OBJDIR)/browse_.c:$(OBJDIR)/browse.h $(OBJDIR)/captcha_.c:$(OBJDIR)/captcha.h $(OBJDIR)/cgi_.c:$(OBJDIR)/cgi.h $(OBJDIR)/checkin_.c:$(OBJDIR)/checkin.h $(OBJDIR)/checkout_.c:$(OBJDIR)/checkout.h $(OBJDIR)/clearsign_.c:$(OBJDIR)/clearsign.h $(OBJDIR)/clone_.c:$(OBJDIR)/clone.h $(OBJDIR)/comformat_.c:$(OBJDIR)/comformat.h $(OBJDIR)/configure_.c:$(OBJDIR)/configure.h $(OBJDIR)/content_.c:$(OBJDIR)/content.h $(OBJDIR)/db_.c:$(OBJDIR)/db.h $(OBJDIR)/delta_.c:$(OBJDIR)/delta.h $(OBJDIR)/deltacmd_.c:$(OBJDIR)/deltacmd.h $(OBJDIR)/descendants_.c:$(OBJDIR)/descendants.h $(OBJDIR)/diff_.c:$(OBJDIR)/diff.h $(OBJDIR)/diffcmd_.c:$(OBJDIR)/diffcmd.h $(OBJDIR)/doc_.c:$(OBJDIR)/doc.h $(OBJDIR)/encode_.c:$(OBJDIR)/encode.h $(OBJDIR)/event_.c:$(OBJDIR)/event.h $(OBJDIR)/export_.c:$(OBJDIR)/export.h $(OBJDIR)/file_.c:$(OBJDIR)/file.h $(OBJDIR)/finfo_.c:$(OBJDIR)/finfo.h $(OBJDIR)/glob_.c:$(OBJDIR)/glob.h $(OBJDIR)/graph_.c:$(OBJDIR)/graph.h $(OBJDIR)/gzip_.c:$(OBJDIR)/gzip.h $(OBJDIR)/http_.c:$(OBJDIR)/http.h $(OBJDIR)/http_socket_.c:$(OBJDIR)/http_socket.h $(OBJDIR)/http_ssl_.c:$(OBJDIR)/http_ssl.h $(OBJDIR)/http_transport_.c:$(OBJDIR)/http_transport.h $(OBJDIR)/import_.c:$(OBJDIR)/import.h $(OBJDIR)/info_.c:$(OBJDIR)/info.h $(OBJDIR)/json_.c:$(OBJDIR)/json.h $(OBJDIR)/json_artifact_.c:$(OBJDIR)/json_artifact.h $(OBJDIR)/json_branch_.c:$(OBJDIR)/json_branch.h $(OBJDIR)/json_config_.c:$(OBJDIR)/json_config.h $(OBJDIR)/json_diff_.c:$(OBJDIR)/json_diff.h $(OBJDIR)/json_login_.c:$(OBJDIR)/json_login.h $(OBJDIR)/json_query_.c:$(OBJDIR)/json_query.h $(OBJDIR)/json_report_.c:$(OBJDIR)/json_report.h $(OBJDIR)/json_tag_.c:$(OBJDIR)/json_tag.h $(OBJDIR)/json_timeline_.c:$(OBJDIR)/json_timeline.h $(OBJDIR)/json_user_.c:$(OBJDIR)/json_user.h $(OBJDIR)/json_wiki_.c:$(OBJDIR)/json_wiki.h $(OBJDIR)/leaf_.c:$(OBJDIR)/leaf.h $(OBJDIR)/login_.c:$(OBJDIR)/login.h $(OBJDIR)/main_.c:$(OBJDIR)/main.h $(OBJDIR)/manifest_.c:$(OBJDIR)/manifest.h $(OBJDIR)/md5_.c:$(OBJDIR)/md5.h $(OBJDIR)/merge_.c:$(OBJDIR)/merge.h $(OBJDIR)/merge3_.c:$(OBJDIR)/merge3.h $(OBJDIR)/name_.c:$(OBJDIR)/name.h $(OBJDIR)/path_.c:$(OBJDIR)/path.h $(OBJDIR)/pivot_.c:$(OBJDIR)/pivot.h $(OBJDIR)/popen_.c:$(OBJDIR)/popen.h $(OBJDIR)/pqueue_.c:$(OBJDIR)/pqueue.h $(OBJDIR)/printf_.c:$(OBJDIR)/printf.h $(OBJDIR)/rebuild_.c:$(OBJDIR)/rebuild.h $(OBJDIR)/report_.c:$(OBJDIR)/report.h $(OBJDIR)/rss_.c:$(OBJDIR)/rss.h $(OBJDIR)/schema_.c:$(OBJDIR)/schema.h $(OBJDIR)/search_.c:$(OBJDIR)/search.h $(OBJDIR)/setup_.c:$(OBJDIR)/setup.h $(OBJDIR)/sha1_.c:$(OBJDIR)/sha1.h $(OBJDIR)/shun_.c:$(OBJDIR)/shun.h $(OBJDIR)/skins_.c:$(OBJDIR)/skins.h $(OBJDIR)/sqlcmd_.c:$(OBJDIR)/sqlcmd.h $(OBJDIR)/stash_.c:$(OBJDIR)/stash.h $(OBJDIR)/stat_.c:$(OBJDIR)/stat.h $(OBJDIR)/style_.c:$(OBJDIR)/style.h $(OBJDIR)/sync_.c:$(OBJDIR)/sync.h $(OBJDIR)/tag_.c:$(OBJDIR)/tag.h $(OBJDIR)/tar_.c:$(OBJDIR)/tar.h $(OBJDIR)/th_main_.c:$(OBJDIR)/th_main.h $(OBJDIR)/timeline_.c:$(OBJDIR)/timeline.h $(OBJDIR)/tkt_.c:$(OBJDIR)/tkt.h $(OBJDIR)/tktsetup_.c:$(OBJDIR)/tktsetup.h $(OBJDIR)/undo_.c:$(OBJDIR)/undo.h $(OBJDIR)/update_.c:$(OBJDIR)/update.h $(OBJDIR)/url_.c:$(OBJDIR)/url.h $(OBJDIR)/user_.c:$(OBJDIR)/user.h $(OBJDIR)/verify_.c:$(OBJDIR)/verify.h $(OBJDIR)/vfile_.c:$(OBJDIR)/vfile.h $(OBJDIR)/wiki_.c:$(OBJDIR)/wiki.h $(OBJDIR)/wikiformat_.c:$(OBJDIR)/wikiformat.h $(OBJDIR)/winhttp_.c:$(OBJDIR)/winhttp.h $(OBJDIR)/xfer_.c:$(OBJDIR)/xfer.h $(OBJDIR)/xfersetup_.c:$(OBJDIR)/xfersetup.h $(OBJDIR)/zip_.c:$(OBJDIR)/zip.h $(SRCDIR)/sqlite3.h $(SRCDIR)/th.h $(OBJDIR)/VERSION.h |
| 537 | echo Done >$(OBJDIR)/headers |
| 538 | |
| 539 | $(OBJDIR)/headers: Makefile |
| 540 | Makefile: |
| 541 | $(OBJDIR)/add_.c: $(SRCDIR)/add.c $(OBJDIR)/translate |
| @@ -811,10 +823,17 @@ | |
| 823 | |
| 824 | $(OBJDIR)/json_branch.o: $(OBJDIR)/json_branch_.c $(OBJDIR)/json_branch.h $(SRCDIR)/config.h |
| 825 | $(XTCC) -o $(OBJDIR)/json_branch.o -c $(OBJDIR)/json_branch_.c |
| 826 | |
| 827 | json_branch.h: $(OBJDIR)/headers |
| 828 | $(OBJDIR)/json_config_.c: $(SRCDIR)/json_config.c $(OBJDIR)/translate |
| 829 | $(TRANSLATE) $(SRCDIR)/json_config.c >$(OBJDIR)/json_config_.c |
| 830 | |
| 831 | $(OBJDIR)/json_config.o: $(OBJDIR)/json_config_.c $(OBJDIR)/json_config.h $(SRCDIR)/config.h |
| 832 | $(XTCC) -o $(OBJDIR)/json_config.o -c $(OBJDIR)/json_config_.c |
| 833 | |
| 834 | json_config.h: $(OBJDIR)/headers |
| 835 | $(OBJDIR)/json_diff_.c: $(SRCDIR)/json_diff.c $(OBJDIR)/translate |
| 836 | $(TRANSLATE) $(SRCDIR)/json_diff.c >$(OBJDIR)/json_diff_.c |
| 837 | |
| 838 | $(OBJDIR)/json_diff.o: $(OBJDIR)/json_diff_.c $(OBJDIR)/json_diff.h $(SRCDIR)/config.h |
| 839 | $(XTCC) -o $(OBJDIR)/json_diff.o -c $(OBJDIR)/json_diff_.c |
| @@ -1188,11 +1207,11 @@ | |
| 1207 | $(XTCC) -DSQLITE_OMIT_LOAD_EXTENSION=1 -DSQLITE_THREADSAFE=0 -DSQLITE_DEFAULT_FILE_FORMAT=4 -DSQLITE_ENABLE_STAT3 -Dlocaltime=fossil_localtime -DSQLITE_ENABLE_LOCKING_STYLE=0 -c $(SRCDIR)/sqlite3.c -o $(OBJDIR)/sqlite3.o |
| 1208 | |
| 1209 | $(OBJDIR)/cson_amalgamation.o: $(SRCDIR)/cson_amalgamation.c |
| 1210 | $(XTCC) -c $(SRCDIR)/cson_amalgamation.c -o $(OBJDIR)/cson_amalgamation.o -DCSON_FOSSIL_MODE |
| 1211 | |
| 1212 | $(OBJDIR)/json.o $(OBJDIR)/json_artifact.o $(OBJDIR)/json_branch.o $(OBJDIR)/json_config.o $(OBJDIR)/json_diff.o $(OBJDIR)/json_login.o $(OBJDIR)/json_query.o $(OBJDIR)/json_report.o $(OBJDIR)/json_tag.o $(OBJDIR)/json_timeline.o $(OBJDIR)/json_user.o $(OBJDIR)/json_wiki.o : $(SRCDIR)/json_detail.h |
| 1213 | |
| 1214 | $(OBJDIR)/shell.o: $(SRCDIR)/shell.c $(SRCDIR)/sqlite3.h |
| 1215 | $(XTCC) -Dmain=sqlite3_shell -DSQLITE_OMIT_LOAD_EXTENSION=1 -c $(SRCDIR)/shell.c -o $(OBJDIR)/shell.o |
| 1216 | |
| 1217 | $(OBJDIR)/th.o: $(SRCDIR)/th.c |
| 1218 |
+92
-98
| --- www/stats.wiki | ||
| +++ www/stats.wiki | ||
| @@ -2,13 +2,14 @@ | ||
| 2 | 2 | <h1 align="center">Performance Statistics</h1> |
| 3 | 3 | |
| 4 | 4 | The questions will inevitably arise: How does Fossil perform? |
| 5 | 5 | Does it use a lot of disk space or bandwidth? Is it scalable? |
| 6 | 6 | |
| 7 | -In an attempt to answers these questions, this report looks at five | |
| 7 | +In an attempt to answers these questions, this report looks at several | |
| 8 | 8 | projects that use fossil for configuration management and examines how |
| 9 | 9 | well they are working. The following table is a summary of the results. |
| 10 | +(Last updated on 2012-02-26.) | |
| 10 | 11 | Explanation and analysis follows the table. |
| 11 | 12 | |
| 12 | 13 | <table border=1> |
| 13 | 14 | <tr> |
| 14 | 15 | <th>Project</th> |
| @@ -21,122 +22,113 @@ | ||
| 21 | 22 | <th>Compression Ratio</th> |
| 22 | 23 | <th>Clone Bandwidth</th> |
| 23 | 24 | </tr> |
| 24 | 25 | |
| 25 | 26 | <tr align="center"> |
| 26 | -<td>SQLite | |
| 27 | -<td>28643 | |
| 28 | -<td>6755 | |
| 29 | -<td>3373 days<br>9.24 yrs | |
| 30 | -<td>2.00 | |
| 31 | -<td>1.27 GB | |
| 32 | -<td>35.4 MB | |
| 33 | -<td>35:1 | |
| 34 | -<td>982 KB up<br>12.4 MB down | |
| 35 | -</tr> | |
| 36 | - | |
| 37 | -<tr align="center"> | |
| 38 | -<td>Fossil | |
| 39 | -<td>4981 | |
| 40 | -<td>1272 | |
| 41 | -<td>764 days<br>2.1 yrs | |
| 42 | -<td>1.66 | |
| 43 | -<td>144 MB | |
| 44 | -<td>8.74 MB | |
| 45 | -<td>16:1 | |
| 46 | -<td>128 KB up<br>4.49 MB down | |
| 47 | -</tr> | |
| 48 | - | |
| 49 | -<tr align="center"> | |
| 50 | -<td>SLT | |
| 51 | -<td>2062 | |
| 52 | -<td>67 | |
| 53 | -<td>266 days | |
| 54 | -<td>0.25 | |
| 55 | -<td>1.76 GB | |
| 56 | -<td>147 MB | |
| 57 | -<td>11:1 | |
| 58 | -<td>1.1 MB up<br>141 MB down | |
| 59 | -</tr> | |
| 60 | - | |
| 61 | -<tr align="center"> | |
| 62 | -<td>TH3 | |
| 63 | -<td>1999 | |
| 64 | -<td>429 | |
| 65 | -<td>331 days | |
| 66 | -<td>1.30 | |
| 67 | -<td>70.5 MB | |
| 68 | -<td>6.3 MB | |
| 69 | -<td>11:1 | |
| 70 | -<td>55 KB up<br>4.66 MB down | |
| 71 | -</tr> | |
| 72 | - | |
| 73 | -<tr align="center"> | |
| 74 | -<td>SQLite Docs | |
| 75 | -<td>1787 | |
| 76 | -<td>444 | |
| 77 | -<td>650 days<br>1.78 yrs | |
| 78 | -<td>0.68 | |
| 79 | -<td>43 MB | |
| 80 | -<td>4.9 MB | |
| 81 | -<td>8:1 | |
| 82 | -<td>46 KB up<br>3.35 MB down | |
| 27 | +<td>[http://www.sqlite.org/src/timeline | SQLite] | |
| 28 | +<td>41113 | |
| 29 | +<td>9943 | |
| 30 | +<td>4290 days<br>11.75 yrs | |
| 31 | +<td>2.32 | |
| 32 | +<td>2.09 GB | |
| 33 | +<td>33.2 MB | |
| 34 | +<td>63:1 | |
| 35 | +<td>23.2 MB | |
| 36 | +</tr> | |
| 37 | + | |
| 38 | +<tr align="center"> | |
| 39 | +<td>[http://core.tcl.tk/tcl/timeline | TCL] | |
| 40 | +<td>74806 | |
| 41 | +<td>13541 | |
| 42 | +<td>5085 days<br>13.92 yrs | |
| 43 | +<td>2.66 | |
| 44 | +<td>5.2 GB | |
| 45 | +<td>86 MB | |
| 46 | +<td>60:1 | |
| 47 | +<td>67.0 MB | |
| 48 | +</tr> | |
| 49 | + | |
| 50 | +<tr align="center"> | |
| 51 | +<td>[/timeline | Fossil] | |
| 52 | +<td>15561 | |
| 53 | +<td>3764 | |
| 54 | +<td>1681 days<br>4.6 yrs | |
| 55 | +<td>2.24 | |
| 56 | +<td>721 MB | |
| 57 | +<td>18.8 MB | |
| 58 | +<td>38:1 | |
| 59 | +<td>12.0 MB | |
| 60 | +</tr> | |
| 61 | + | |
| 62 | +<tr align="center"> | |
| 63 | +<td>[http://www.sqlite.org/slt/timeline | SLT] | |
| 64 | +<td>2174 | |
| 65 | +<td>100 | |
| 66 | +<td>1183 days<br>3.24 yrs | |
| 67 | +<td>0.08 | |
| 68 | +<td>1.94 GB | |
| 69 | +<td>143 MB | |
| 70 | +<td>12:1 | |
| 71 | +<td>141 MB | |
| 72 | +</tr> | |
| 73 | + | |
| 74 | +<tr align="center"> | |
| 75 | +<td>[http://www.sqlite.org/th3.html | TH3] | |
| 76 | +<td>5624 | |
| 77 | +<td>1472 | |
| 78 | +<td>1248 days<br>3.42 yrs | |
| 79 | +<td>1.78 | |
| 80 | +<td>252 MB | |
| 81 | +<td>12.5 MB | |
| 82 | +<td>20:1 | |
| 83 | +<td>12.2 MB | |
| 84 | +</tr> | |
| 85 | + | |
| 86 | +<tr align="center"> | |
| 87 | +<td>[http://www.sqlite.org/docsrc/timeline | SQLite Docs] | |
| 88 | +<td>3664 | |
| 89 | +<td>1003 | |
| 90 | +<td>1567 days<br>4.29 yrs | |
| 91 | +<td>0.64 | |
| 92 | +<td>108 MB | |
| 93 | +<td>6.6 MB | |
| 94 | +<td>16:1 | |
| 95 | +<td>5.71 MB | |
| 83 | 96 | </tr> |
| 84 | 97 | |
| 85 | 98 | </table> |
| 86 | 99 | |
| 87 | -<h2>The Five Projects</h2> | |
| 88 | - | |
| 89 | -The five projects listed above were chosen because they have been in | |
| 90 | -existance for a long time (relative to the age of fossil) or because | |
| 91 | -they have larges amounts of content. The most important project using | |
| 92 | -fossil is SQLite. Fossil itself | |
| 93 | -is built on top of SQLite and so obviously SQLite has to predate fossil. | |
| 94 | -SQLite was originally versioned using CVS, but recently the entire 9-year | |
| 95 | -and 320-MB CVS history of SQLite was converted over to Fossil. This is | |
| 96 | -an important datapoint because it demonstrates fossil's ability to manage | |
| 97 | -a significant and long-running project. | |
| 98 | -The next-longest running fossil project is fossil itself, at 2.1 years. | |
| 99 | -The documentation for SQLite | |
| 100 | -(identified above as "SQLite Docs") was split off of the main SQLite | |
| 101 | -source tree and into its own fossil repository about 1.75 years ago. | |
| 102 | -The "SQL Logic Test" or "SLT" project is a massive | |
| 103 | -collection of SQL statements and their output used to compare the | |
| 104 | -processing of SQLite against MySQL, PostgreSQL, Microsoft SQL Server, | |
| 105 | -and Oracle. | |
| 106 | -Finally "TH3" is a proprietary set of test cases for SQLite used to give | |
| 107 | -100% branch test coverage of SQLite on embedded platforms. All projects | |
| 108 | -except for TH3 are open-source. | |
| 109 | - | |
| 110 | 100 | <h2>Measured Attributes</h2> |
| 111 | 101 | |
| 112 | -In fossil, every version of every file, every wiki page, every change to | |
| 102 | +In Fossil, every version of every file, every wiki page, every change to | |
| 113 | 103 | every ticket, and every check-in is a separate "artifact". One way to |
| 114 | -think of a fossil project is as a bag of artifacts. Of course, there is | |
| 115 | -a lot more than this going on in fossil. Many of the artifacts have meaning | |
| 104 | +think of a Fossil project is as a bag of artifacts. Of course, there is | |
| 105 | +a lot more than this going on in Fossil. Many of the artifacts have meaning | |
| 116 | 106 | and are related to other artifacts. But at a low level (for example when |
| 117 | 107 | synchronizing two instances of the same project) the only thing that matters |
| 118 | 108 | is the unordered collection of artifacts. In fact, one of the key |
| 119 | -characteristics of fossil is that the entire project history can be | |
| 109 | +characteristics of Fossil is that the entire project history can be | |
| 120 | 110 | reconstructed simply by scanning the artifacts in an arbitrary order. |
| 121 | 111 | |
| 122 | 112 | The number of check-ins is the number of times that the "commit" command |
| 123 | 113 | has been run. A single check-in might change a 3 or 4 files, or it might |
| 124 | -change several dozen different files. Regardless of the number of files | |
| 114 | +change dozens or hundreds of files. Regardless of the number of files | |
| 125 | 115 | changed, it still only counts as one check-in. |
| 126 | 116 | |
| 127 | 117 | The "Uncompressed Size" is the total size of all the artifacts within |
| 128 | -the fossil repository assuming they were all uncompressed and stored | |
| 118 | +the repository assuming they were all uncompressed and stored | |
| 129 | 119 | separately on the disk. Fossil makes use of delta compression between related |
| 130 | 120 | versions of the same file, and then uses zlib compression on the resulting |
| 131 | 121 | deltas. The total resulting repository size is shown after the uncompressed |
| 132 | -size. | |
| 122 | +size. For this chart, "fossil rebuild --compress" was run on each repository | |
| 123 | +prior to measuring its compressed size. Repository sizes would typically | |
| 124 | +be 20% larger without that rebuild. | |
| 133 | 125 | |
| 134 | 126 | On the right end of the table, we show the "Clone Bandwidth". This is the |
| 135 | -total number of bytes sent from client to server ("uplink") and from server | |
| 136 | -back to client ("downlink") in order to clone a repository. These byte counts | |
| 137 | -include HTTP protocol overhead. | |
| 127 | +total number of bytes sent from server back to the client. The number of | |
| 128 | +bytes sent from client to server is neglible in comparison. | |
| 129 | +These byte counts include HTTP protocol overhead. | |
| 138 | 130 | |
| 139 | 131 | In the table and throughout this article, |
| 140 | 132 | "GB" means gigabytes (10<sup><small>9</small></sup> bytes) |
| 141 | 133 | not <a href="http://en.wikipedia.org/wiki/Gibibyte">gibibytes</a> |
| 142 | 134 | (2<sup><small>30</small></sup> bytes). Similarly, "MB" and "KB" |
| @@ -144,22 +136,24 @@ | ||
| 144 | 136 | |
| 145 | 137 | <h2>Analysis And Supplimental Data</h2> |
| 146 | 138 | |
| 147 | 139 | Perhaps the two most interesting datapoints in the above table are SQLite |
| 148 | 140 | and SLT. SQLite is a long-running project with long revision chains. |
| 149 | -Some of the files in SQLite have been edited close to a thousand times. | |
| 141 | +Some of the files in SQLite have been edited over a thousand times. | |
| 150 | 142 | Each of these edits is stored as a delta, and hence the SQLite project |
| 151 | -gets excellent 35:1 compression. SLT, on the other hand, consists of | |
| 143 | +gets excellent 63:1 compression. SLT, on the other hand, consists of | |
| 152 | 144 | many large (megabyte-sized) SQL scripts that have one or maybe two |
| 153 | -versions. There is very little delta compression occurring and so the | |
| 145 | +edits each. There is very little delta compression occurring and so the | |
| 154 | 146 | overall repository compression ratio is much lower. Note also that |
| 155 | 147 | quite a bit more bandwidth is required to clone SLT than SQLite. |
| 156 | 148 | |
| 157 | 149 | For the first nine years of its development, SQLite was versioned by CVS. |
| 158 | 150 | The resulting CVS repository measured over 320MB in size. So, the |
| 159 | -developers were | |
| 160 | -pleasently surprised to see that this entire project could be cloned in | |
| 161 | -fossil using only about 13MB of network traffic. The "sync" protocol | |
| 151 | +developers were surprised to see that this entire project could be cloned in | |
| 152 | +fossil using only about 23.2MB of network traffic. (This 23.2MB includes | |
| 153 | +all the changes to SQLite that have been made since the conversion from | |
| 154 | +CVS. Of those changes are omitted, the clone bandwidth drops to 13MB.) | |
| 155 | +The "sync" protocol | |
| 162 | 156 | used by fossil has turned out to be surprisingly efficient. A typical |
| 163 | 157 | check-in on SQLite might use 3 or 4KB of network bandwidth total. Hardly |
| 164 | 158 | worth measuring. The sync protocol is efficient enough that, once cloned, |
| 165 | -fossil could easily be used over a dial-up connection. | |
| 159 | +Fossil could easily be used over a dial-up connection. | |
| 166 | 160 |
| --- www/stats.wiki | |
| +++ www/stats.wiki | |
| @@ -2,13 +2,14 @@ | |
| 2 | <h1 align="center">Performance Statistics</h1> |
| 3 | |
| 4 | The questions will inevitably arise: How does Fossil perform? |
| 5 | Does it use a lot of disk space or bandwidth? Is it scalable? |
| 6 | |
| 7 | In an attempt to answers these questions, this report looks at five |
| 8 | projects that use fossil for configuration management and examines how |
| 9 | well they are working. The following table is a summary of the results. |
| 10 | Explanation and analysis follows the table. |
| 11 | |
| 12 | <table border=1> |
| 13 | <tr> |
| 14 | <th>Project</th> |
| @@ -21,122 +22,113 @@ | |
| 21 | <th>Compression Ratio</th> |
| 22 | <th>Clone Bandwidth</th> |
| 23 | </tr> |
| 24 | |
| 25 | <tr align="center"> |
| 26 | <td>SQLite |
| 27 | <td>28643 |
| 28 | <td>6755 |
| 29 | <td>3373 days<br>9.24 yrs |
| 30 | <td>2.00 |
| 31 | <td>1.27 GB |
| 32 | <td>35.4 MB |
| 33 | <td>35:1 |
| 34 | <td>982 KB up<br>12.4 MB down |
| 35 | </tr> |
| 36 | |
| 37 | <tr align="center"> |
| 38 | <td>Fossil |
| 39 | <td>4981 |
| 40 | <td>1272 |
| 41 | <td>764 days<br>2.1 yrs |
| 42 | <td>1.66 |
| 43 | <td>144 MB |
| 44 | <td>8.74 MB |
| 45 | <td>16:1 |
| 46 | <td>128 KB up<br>4.49 MB down |
| 47 | </tr> |
| 48 | |
| 49 | <tr align="center"> |
| 50 | <td>SLT |
| 51 | <td>2062 |
| 52 | <td>67 |
| 53 | <td>266 days |
| 54 | <td>0.25 |
| 55 | <td>1.76 GB |
| 56 | <td>147 MB |
| 57 | <td>11:1 |
| 58 | <td>1.1 MB up<br>141 MB down |
| 59 | </tr> |
| 60 | |
| 61 | <tr align="center"> |
| 62 | <td>TH3 |
| 63 | <td>1999 |
| 64 | <td>429 |
| 65 | <td>331 days |
| 66 | <td>1.30 |
| 67 | <td>70.5 MB |
| 68 | <td>6.3 MB |
| 69 | <td>11:1 |
| 70 | <td>55 KB up<br>4.66 MB down |
| 71 | </tr> |
| 72 | |
| 73 | <tr align="center"> |
| 74 | <td>SQLite Docs |
| 75 | <td>1787 |
| 76 | <td>444 |
| 77 | <td>650 days<br>1.78 yrs |
| 78 | <td>0.68 |
| 79 | <td>43 MB |
| 80 | <td>4.9 MB |
| 81 | <td>8:1 |
| 82 | <td>46 KB up<br>3.35 MB down |
| 83 | </tr> |
| 84 | |
| 85 | </table> |
| 86 | |
| 87 | <h2>The Five Projects</h2> |
| 88 | |
| 89 | The five projects listed above were chosen because they have been in |
| 90 | existance for a long time (relative to the age of fossil) or because |
| 91 | they have larges amounts of content. The most important project using |
| 92 | fossil is SQLite. Fossil itself |
| 93 | is built on top of SQLite and so obviously SQLite has to predate fossil. |
| 94 | SQLite was originally versioned using CVS, but recently the entire 9-year |
| 95 | and 320-MB CVS history of SQLite was converted over to Fossil. This is |
| 96 | an important datapoint because it demonstrates fossil's ability to manage |
| 97 | a significant and long-running project. |
| 98 | The next-longest running fossil project is fossil itself, at 2.1 years. |
| 99 | The documentation for SQLite |
| 100 | (identified above as "SQLite Docs") was split off of the main SQLite |
| 101 | source tree and into its own fossil repository about 1.75 years ago. |
| 102 | The "SQL Logic Test" or "SLT" project is a massive |
| 103 | collection of SQL statements and their output used to compare the |
| 104 | processing of SQLite against MySQL, PostgreSQL, Microsoft SQL Server, |
| 105 | and Oracle. |
| 106 | Finally "TH3" is a proprietary set of test cases for SQLite used to give |
| 107 | 100% branch test coverage of SQLite on embedded platforms. All projects |
| 108 | except for TH3 are open-source. |
| 109 | |
| 110 | <h2>Measured Attributes</h2> |
| 111 | |
| 112 | In fossil, every version of every file, every wiki page, every change to |
| 113 | every ticket, and every check-in is a separate "artifact". One way to |
| 114 | think of a fossil project is as a bag of artifacts. Of course, there is |
| 115 | a lot more than this going on in fossil. Many of the artifacts have meaning |
| 116 | and are related to other artifacts. But at a low level (for example when |
| 117 | synchronizing two instances of the same project) the only thing that matters |
| 118 | is the unordered collection of artifacts. In fact, one of the key |
| 119 | characteristics of fossil is that the entire project history can be |
| 120 | reconstructed simply by scanning the artifacts in an arbitrary order. |
| 121 | |
| 122 | The number of check-ins is the number of times that the "commit" command |
| 123 | has been run. A single check-in might change a 3 or 4 files, or it might |
| 124 | change several dozen different files. Regardless of the number of files |
| 125 | changed, it still only counts as one check-in. |
| 126 | |
| 127 | The "Uncompressed Size" is the total size of all the artifacts within |
| 128 | the fossil repository assuming they were all uncompressed and stored |
| 129 | separately on the disk. Fossil makes use of delta compression between related |
| 130 | versions of the same file, and then uses zlib compression on the resulting |
| 131 | deltas. The total resulting repository size is shown after the uncompressed |
| 132 | size. |
| 133 | |
| 134 | On the right end of the table, we show the "Clone Bandwidth". This is the |
| 135 | total number of bytes sent from client to server ("uplink") and from server |
| 136 | back to client ("downlink") in order to clone a repository. These byte counts |
| 137 | include HTTP protocol overhead. |
| 138 | |
| 139 | In the table and throughout this article, |
| 140 | "GB" means gigabytes (10<sup><small>9</small></sup> bytes) |
| 141 | not <a href="http://en.wikipedia.org/wiki/Gibibyte">gibibytes</a> |
| 142 | (2<sup><small>30</small></sup> bytes). Similarly, "MB" and "KB" |
| @@ -144,22 +136,24 @@ | |
| 144 | |
| 145 | <h2>Analysis And Supplimental Data</h2> |
| 146 | |
| 147 | Perhaps the two most interesting datapoints in the above table are SQLite |
| 148 | and SLT. SQLite is a long-running project with long revision chains. |
| 149 | Some of the files in SQLite have been edited close to a thousand times. |
| 150 | Each of these edits is stored as a delta, and hence the SQLite project |
| 151 | gets excellent 35:1 compression. SLT, on the other hand, consists of |
| 152 | many large (megabyte-sized) SQL scripts that have one or maybe two |
| 153 | versions. There is very little delta compression occurring and so the |
| 154 | overall repository compression ratio is much lower. Note also that |
| 155 | quite a bit more bandwidth is required to clone SLT than SQLite. |
| 156 | |
| 157 | For the first nine years of its development, SQLite was versioned by CVS. |
| 158 | The resulting CVS repository measured over 320MB in size. So, the |
| 159 | developers were |
| 160 | pleasently surprised to see that this entire project could be cloned in |
| 161 | fossil using only about 13MB of network traffic. The "sync" protocol |
| 162 | used by fossil has turned out to be surprisingly efficient. A typical |
| 163 | check-in on SQLite might use 3 or 4KB of network bandwidth total. Hardly |
| 164 | worth measuring. The sync protocol is efficient enough that, once cloned, |
| 165 | fossil could easily be used over a dial-up connection. |
| 166 |
| --- www/stats.wiki | |
| +++ www/stats.wiki | |
| @@ -2,13 +2,14 @@ | |
| 2 | <h1 align="center">Performance Statistics</h1> |
| 3 | |
| 4 | The questions will inevitably arise: How does Fossil perform? |
| 5 | Does it use a lot of disk space or bandwidth? Is it scalable? |
| 6 | |
| 7 | In an attempt to answers these questions, this report looks at several |
| 8 | projects that use fossil for configuration management and examines how |
| 9 | well they are working. The following table is a summary of the results. |
| 10 | (Last updated on 2012-02-26.) |
| 11 | Explanation and analysis follows the table. |
| 12 | |
| 13 | <table border=1> |
| 14 | <tr> |
| 15 | <th>Project</th> |
| @@ -21,122 +22,113 @@ | |
| 22 | <th>Compression Ratio</th> |
| 23 | <th>Clone Bandwidth</th> |
| 24 | </tr> |
| 25 | |
| 26 | <tr align="center"> |
| 27 | <td>[http://www.sqlite.org/src/timeline | SQLite] |
| 28 | <td>41113 |
| 29 | <td>9943 |
| 30 | <td>4290 days<br>11.75 yrs |
| 31 | <td>2.32 |
| 32 | <td>2.09 GB |
| 33 | <td>33.2 MB |
| 34 | <td>63:1 |
| 35 | <td>23.2 MB |
| 36 | </tr> |
| 37 | |
| 38 | <tr align="center"> |
| 39 | <td>[http://core.tcl.tk/tcl/timeline | TCL] |
| 40 | <td>74806 |
| 41 | <td>13541 |
| 42 | <td>5085 days<br>13.92 yrs |
| 43 | <td>2.66 |
| 44 | <td>5.2 GB |
| 45 | <td>86 MB |
| 46 | <td>60:1 |
| 47 | <td>67.0 MB |
| 48 | </tr> |
| 49 | |
| 50 | <tr align="center"> |
| 51 | <td>[/timeline | Fossil] |
| 52 | <td>15561 |
| 53 | <td>3764 |
| 54 | <td>1681 days<br>4.6 yrs |
| 55 | <td>2.24 |
| 56 | <td>721 MB |
| 57 | <td>18.8 MB |
| 58 | <td>38:1 |
| 59 | <td>12.0 MB |
| 60 | </tr> |
| 61 | |
| 62 | <tr align="center"> |
| 63 | <td>[http://www.sqlite.org/slt/timeline | SLT] |
| 64 | <td>2174 |
| 65 | <td>100 |
| 66 | <td>1183 days<br>3.24 yrs |
| 67 | <td>0.08 |
| 68 | <td>1.94 GB |
| 69 | <td>143 MB |
| 70 | <td>12:1 |
| 71 | <td>141 MB |
| 72 | </tr> |
| 73 | |
| 74 | <tr align="center"> |
| 75 | <td>[http://www.sqlite.org/th3.html | TH3] |
| 76 | <td>5624 |
| 77 | <td>1472 |
| 78 | <td>1248 days<br>3.42 yrs |
| 79 | <td>1.78 |
| 80 | <td>252 MB |
| 81 | <td>12.5 MB |
| 82 | <td>20:1 |
| 83 | <td>12.2 MB |
| 84 | </tr> |
| 85 | |
| 86 | <tr align="center"> |
| 87 | <td>[http://www.sqlite.org/docsrc/timeline | SQLite Docs] |
| 88 | <td>3664 |
| 89 | <td>1003 |
| 90 | <td>1567 days<br>4.29 yrs |
| 91 | <td>0.64 |
| 92 | <td>108 MB |
| 93 | <td>6.6 MB |
| 94 | <td>16:1 |
| 95 | <td>5.71 MB |
| 96 | </tr> |
| 97 | |
| 98 | </table> |
| 99 | |
| 100 | <h2>Measured Attributes</h2> |
| 101 | |
| 102 | In Fossil, every version of every file, every wiki page, every change to |
| 103 | every ticket, and every check-in is a separate "artifact". One way to |
| 104 | think of a Fossil project is as a bag of artifacts. Of course, there is |
| 105 | a lot more than this going on in Fossil. Many of the artifacts have meaning |
| 106 | and are related to other artifacts. But at a low level (for example when |
| 107 | synchronizing two instances of the same project) the only thing that matters |
| 108 | is the unordered collection of artifacts. In fact, one of the key |
| 109 | characteristics of Fossil is that the entire project history can be |
| 110 | reconstructed simply by scanning the artifacts in an arbitrary order. |
| 111 | |
| 112 | The number of check-ins is the number of times that the "commit" command |
| 113 | has been run. A single check-in might change a 3 or 4 files, or it might |
| 114 | change dozens or hundreds of files. Regardless of the number of files |
| 115 | changed, it still only counts as one check-in. |
| 116 | |
| 117 | The "Uncompressed Size" is the total size of all the artifacts within |
| 118 | the repository assuming they were all uncompressed and stored |
| 119 | separately on the disk. Fossil makes use of delta compression between related |
| 120 | versions of the same file, and then uses zlib compression on the resulting |
| 121 | deltas. The total resulting repository size is shown after the uncompressed |
| 122 | size. For this chart, "fossil rebuild --compress" was run on each repository |
| 123 | prior to measuring its compressed size. Repository sizes would typically |
| 124 | be 20% larger without that rebuild. |
| 125 | |
| 126 | On the right end of the table, we show the "Clone Bandwidth". This is the |
| 127 | total number of bytes sent from server back to the client. The number of |
| 128 | bytes sent from client to server is neglible in comparison. |
| 129 | These byte counts include HTTP protocol overhead. |
| 130 | |
| 131 | In the table and throughout this article, |
| 132 | "GB" means gigabytes (10<sup><small>9</small></sup> bytes) |
| 133 | not <a href="http://en.wikipedia.org/wiki/Gibibyte">gibibytes</a> |
| 134 | (2<sup><small>30</small></sup> bytes). Similarly, "MB" and "KB" |
| @@ -144,22 +136,24 @@ | |
| 136 | |
| 137 | <h2>Analysis And Supplimental Data</h2> |
| 138 | |
| 139 | Perhaps the two most interesting datapoints in the above table are SQLite |
| 140 | and SLT. SQLite is a long-running project with long revision chains. |
| 141 | Some of the files in SQLite have been edited over a thousand times. |
| 142 | Each of these edits is stored as a delta, and hence the SQLite project |
| 143 | gets excellent 63:1 compression. SLT, on the other hand, consists of |
| 144 | many large (megabyte-sized) SQL scripts that have one or maybe two |
| 145 | edits each. There is very little delta compression occurring and so the |
| 146 | overall repository compression ratio is much lower. Note also that |
| 147 | quite a bit more bandwidth is required to clone SLT than SQLite. |
| 148 | |
| 149 | For the first nine years of its development, SQLite was versioned by CVS. |
| 150 | The resulting CVS repository measured over 320MB in size. So, the |
| 151 | developers were surprised to see that this entire project could be cloned in |
| 152 | fossil using only about 23.2MB of network traffic. (This 23.2MB includes |
| 153 | all the changes to SQLite that have been made since the conversion from |
| 154 | CVS. Of those changes are omitted, the clone bandwidth drops to 13MB.) |
| 155 | The "sync" protocol |
| 156 | used by fossil has turned out to be surprisingly efficient. A typical |
| 157 | check-in on SQLite might use 3 or 4KB of network bandwidth total. Hardly |
| 158 | worth measuring. The sync protocol is efficient enough that, once cloned, |
| 159 | Fossil could easily be used over a dial-up connection. |
| 160 |