Fossil SCM
Fixed a C99-ism, removed a couple ancient #if blocks. Re-added uuid to /json/timeline/event output (because it's useful in ways which the event name is not).
Commit
57e75eb7f034ee787bfe46dca3d4c1ec7696e702bcc8c0c91eeac6930a3a46c6
Parent
2488996f64d78d5…
1 file changed
+4
-10
+4
-10
| --- src/json_timeline.c | ||
| +++ src/json_timeline.c | ||
| @@ -552,25 +552,19 @@ | ||
| 552 | 552 | cson_object_set(pay, "timelineSql", cson_value_new_string(blob_buffer(&sql),strlen(blob_buffer(&sql)))); |
| 553 | 553 | #endif |
| 554 | 554 | db_multi_exec("%s", blob_buffer(&sql) /*safe-for-%s*/); |
| 555 | 555 | blob_reset(&sql); |
| 556 | 556 | db_prepare(&q, "SELECT" |
| 557 | - // uuid is not useful for events | |
| 557 | + /* For events, the name is generally more useful than | |
| 558 | + the uuid, but the uuid is unambiguous and can be used | |
| 559 | + with commands like 'artifact'. */ | |
| 558 | 560 | " substr((SELECT tagname FROM tag AS tn WHERE tn.tagid=json_timeline.tagId AND tagname LIKE 'event-%%'),7) AS name," |
| 561 | + " uuid as uuid," | |
| 559 | 562 | " mtime AS timestamp," |
| 560 | -#if 0 | |
| 561 | - " timestampString AS timestampString," | |
| 562 | -#endif | |
| 563 | 563 | " comment AS comment, " |
| 564 | 564 | " user AS user," |
| 565 | 565 | " eventType AS eventType" |
| 566 | -#if 0 | |
| 567 | - /* TODO implement tags for events */ | |
| 568 | - " tags AS tags," /*FIXME: split this into | |
| 569 | - a JSON array*/ | |
| 570 | - " tagId AS tagId," | |
| 571 | -#endif | |
| 572 | 566 | " FROM json_timeline" |
| 573 | 567 | " ORDER BY rowid"); |
| 574 | 568 | list = cson_new_array(); |
| 575 | 569 | json_stmt_to_array_of_obj(&q, list); |
| 576 | 570 | cson_object_set(pay, "timeline", cson_array_value(list)); |
| 577 | 571 |
| --- src/json_timeline.c | |
| +++ src/json_timeline.c | |
| @@ -552,25 +552,19 @@ | |
| 552 | cson_object_set(pay, "timelineSql", cson_value_new_string(blob_buffer(&sql),strlen(blob_buffer(&sql)))); |
| 553 | #endif |
| 554 | db_multi_exec("%s", blob_buffer(&sql) /*safe-for-%s*/); |
| 555 | blob_reset(&sql); |
| 556 | db_prepare(&q, "SELECT" |
| 557 | // uuid is not useful for events |
| 558 | " substr((SELECT tagname FROM tag AS tn WHERE tn.tagid=json_timeline.tagId AND tagname LIKE 'event-%%'),7) AS name," |
| 559 | " mtime AS timestamp," |
| 560 | #if 0 |
| 561 | " timestampString AS timestampString," |
| 562 | #endif |
| 563 | " comment AS comment, " |
| 564 | " user AS user," |
| 565 | " eventType AS eventType" |
| 566 | #if 0 |
| 567 | /* TODO implement tags for events */ |
| 568 | " tags AS tags," /*FIXME: split this into |
| 569 | a JSON array*/ |
| 570 | " tagId AS tagId," |
| 571 | #endif |
| 572 | " FROM json_timeline" |
| 573 | " ORDER BY rowid"); |
| 574 | list = cson_new_array(); |
| 575 | json_stmt_to_array_of_obj(&q, list); |
| 576 | cson_object_set(pay, "timeline", cson_array_value(list)); |
| 577 |
| --- src/json_timeline.c | |
| +++ src/json_timeline.c | |
| @@ -552,25 +552,19 @@ | |
| 552 | cson_object_set(pay, "timelineSql", cson_value_new_string(blob_buffer(&sql),strlen(blob_buffer(&sql)))); |
| 553 | #endif |
| 554 | db_multi_exec("%s", blob_buffer(&sql) /*safe-for-%s*/); |
| 555 | blob_reset(&sql); |
| 556 | db_prepare(&q, "SELECT" |
| 557 | /* For events, the name is generally more useful than |
| 558 | the uuid, but the uuid is unambiguous and can be used |
| 559 | with commands like 'artifact'. */ |
| 560 | " substr((SELECT tagname FROM tag AS tn WHERE tn.tagid=json_timeline.tagId AND tagname LIKE 'event-%%'),7) AS name," |
| 561 | " uuid as uuid," |
| 562 | " mtime AS timestamp," |
| 563 | " comment AS comment, " |
| 564 | " user AS user," |
| 565 | " eventType AS eventType" |
| 566 | " FROM json_timeline" |
| 567 | " ORDER BY rowid"); |
| 568 | list = cson_new_array(); |
| 569 | json_stmt_to_array_of_obj(&q, list); |
| 570 | cson_object_set(pay, "timeline", cson_array_value(list)); |
| 571 |