Hi, all!

After months of putting this off out of fear it would
be ridiculously difficult to implement, today i learned that it wasn't
really all that hard...

  fossil json dir

is basically the JSON equivalent of the /dir HTML page. Using that along
with /json/artifact, it should be possible to traverse through most
relevant info for the file tree (if it's not possible then please report
the omission). i'm not 100% happy with the output structure, but it was the
least distasteful of the 3 i tried. Opinions/suggestions for improvement
are welcomed.

[stephan@tiny:~/cvs/fossil/fossil]$ f json dir -ci trunk -I 2
{
  "fossil":"b82563d7f7281d3b104f33e58ffc05f38e2890bd",
  "timestamp":1331917028,
  "command":"dir",
  "procTimeMs":24,
  "payload":{
    "name":"/",
    "uuid":"b82563d7f7281d3b104f33e58ffc05f38e2890bd",
    "checkin":"trunk",
    "entries":[
      {
        "isDir":true,
        "uuid":"133f25a88f21479a20cc3b20a8dfa0f0fa807ffc",
        "name":"ajax"
      },
      ...
}

It does not yet have an option to recurse into subdirs, but you can crawl
it by subsequent requests which ask for specific subdirs, e.g.:

e,g,

http://fossil.wanderinghorse.net/repos/fwiki/index.cgi/json/dir?ci=tip&indent=2

does not recurse into this sub-dir:

http://fossil.wanderinghorse.net/repos/fwiki/index.cgi/json/dir?ci=tip&indent=2&name=js

This feature requires a "bleeding edge" trunk.

Happy Hacking!

-- 
----- stephan beal
http://wanderinghorse.net/home/stephan/
http://gplus.to/sgbeal
_______________________________________________
fossil-users mailing list
[email protected]
http://lists.fossil-scm.org:8080/cgi-bin/mailman/listinfo/fossil-users

Reply via email to