Hiya!

i've started implementing the /json/timeline handling. i'm going to break it
down into /ci, /wiki, and /ticket (any others?) because the structures are
very different for each. This initial code doesn't do all that much but set
up some of the infrastructure, but it didn't take long to throw together, so
i'm hopeful that we'll have something usable very soon.

Here's a quick example... this is first-draft/alpha quality, still subject
to many changes - and please ignore the fact that i'm setting CLI options
options via environment variables (that's a workaround for the time being):

(And ignore the SQL code - that of course won't be in any production code!)

stephan@tiny:~/cvs/fossil/fossil-json$ n=1 indent=2 ./fossil json timeline
ci
{
  "fossil":"6ce6b5e63ff041a757db81bd587dec5032bc0769",
  "timestamp":1316558823,
  "payload":{
    "timelineSql":"INSERT OR IGNORE INTO timeline SELECT\n  blob.rid AS
blobRid,\n  uuid AS uuid,\n  datetime(event.mtime,'localtime') AS
timestamp,\n  coalesce(ecomment, comment) AS comment,\n  coalesce(euser,
user) AS user,\n  blob.rid IN leaf AS leaf,\n  bgcolor AS bgColor,\n
 event.type AS eventType,\n  (SELECT group_concat(substr(tagname,5), ', ')
FROM tag, tagxref\n    WHERE tagname GLOB 'sym-*' AND
tag.tagid=tagxref.tagid\n      AND tagxref.rid=blob.rid AND
tagxref.tagtype>0) AS tags,\n  tagid AS tagid,\n  brief AS brief,\n
 event.mtime AS mtime\n FROM event JOIN blob\nWHERE
blob.rid=event.objid\nAND event.type IN('ci') ORDER BY mtime DESC LIMIT 1 ",
    "timeline":[{
        "rid":13752,
        "uuid":"eff3f7d92960b0a0af2599bf19bd238afcd4d3b8",
        "timestamp":"2011-09-20 22:42:58",
        "comment":"Started adding /json/timeline support, but this is gonna
be a doozie. Breaking it down into separate calls for ci/wiki/ticket, e.g.
/json/timeline/ci because the structures will be different for each.",
        "user":"stephan",
        "isLeaf":1,
        "bgColor":null,
        "eventType":"ci",
        "tagList":"json",
        "tagId":null,
        "shortText":null
      }]
  }
}

(and i hope your mail client wraps that!)

-- 
----- stephan beal
http://wanderinghorse.net/home/stephan/
_______________________________________________
fossil-users mailing list
fossil-users@lists.fossil-scm.org
http://lists.fossil-scm.org:8080/cgi-bin/mailman/listinfo/fossil-users

Reply via email to