On Wed, Feb 13, 2013 at 10:08 PM, Stephan Beal <[email protected]>wrote:
> On Wed, Feb 13, 2013 at 8:50 PM, Ross Berteig <[email protected]>wrote: > >> While true that you primarily use JSON in CLI mode as a debugging aid, it >> is a good tool for scripting fossil due to the much easier to parse output. >> Extending JSON to cover some capabilities that require a checkout would not >> harm the normal use of JSON as a remote API, and could aid those trying to >> tame some of the more unruly human-readable output of the natural fossil >> CLI interface. >> > > i've been looking it over tonight, and the db_open_local() routine gives > us most of what we need there - opening (if it can) or failing non-fatally > (i.e. it returns false on error, as opposed to fatally failing). i'll > experiment with a 'changes' command over the weekend - status_report() (in > checkin.c) provides most of the logic, it just needs to be reworked a bit > for JSON's purposes. > Hi, Ross, Pirate, und Co., over the weekend i threw together a first rough prototype of a "json status" command. It doesn't do anything useful, but demonstrates the feasibility of adding support for (some) commands which require a local checkout. i'm hacking on it "between tasks" at the moment, and am looking for specific input on what commands you guys would find most useful to see supported this way. [stephan@host:~/cvs/fossil]$ ./fossil/fossil json status { "fossil":"b27c0d6d3fd0abe50a14e85b557f16fdbab94fab", "timestamp":1361198917, "resultCode":"FOSSIL-4102", "resultText":"use --repository or -R to specify the repository database", "command":"", "procTimeMs":1 } [stephan@host:~/cvs/fossil]$ ./fossil/fossil json status -R fossil.fsl { "fossil":"b27c0d6d3fd0abe50a14e85b557f16fdbab94fab", "timestamp":1361198922, "resultCode":"FOSSIL-4104", "resultText":"Command requires a local checkout.", "command":"status", "procTimeMs":1 } [stephan@host:~/cvs/fossil]$ cd fossil [stephan@host:~/cvs/fossil/fossil]$ ./fossil json status { "fossil":"b27c0d6d3fd0abe50a14e85b557f16fdbab94fab", "timestamp":1361198979, "command":"status", "procTimeMs":4, "payload":{ /* content here is TODO */ } } -- ----- 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

