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).

stephan 2018-06-20 18:15 ben-json-timeline
Commit 57e75eb7f034ee787bfe46dca3d4c1ec7696e702bcc8c0c91eeac6930a3a46c6
1 file changed +4 -10
--- src/json_timeline.c
+++ src/json_timeline.c
@@ -552,25 +552,19 @@
552552
cson_object_set(pay, "timelineSql", cson_value_new_string(blob_buffer(&sql),strlen(blob_buffer(&sql))));
553553
#endif
554554
db_multi_exec("%s", blob_buffer(&sql) /*safe-for-%s*/);
555555
blob_reset(&sql);
556556
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'. */
558560
" substr((SELECT tagname FROM tag AS tn WHERE tn.tagid=json_timeline.tagId AND tagname LIKE 'event-%%'),7) AS name,"
561
+ " uuid as uuid,"
559562
" mtime AS timestamp,"
560
-#if 0
561
- " timestampString AS timestampString,"
562
-#endif
563563
" comment AS comment, "
564564
" user AS user,"
565565
" 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
572566
" FROM json_timeline"
573567
" ORDER BY rowid");
574568
list = cson_new_array();
575569
json_stmt_to_array_of_obj(&q, list);
576570
cson_object_set(pay, "timeline", cson_array_value(list));
577571
--- 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

Keyboard Shortcuts

Open search /
Next entry (timeline) j
Previous entry (timeline) k
Open focused entry Enter
Show this help ?
Toggle theme Top nav button