--- /dev/null Thu Jan 01 00:00:00 1970 +0000
+++ b/examples/log.lua Sat Sep 10 20:02:58 2016 +0800
+local cjson_safe = require('cjson.safe')
+local hglib = require('hglib')
+local client = hglib.Client.open()
+client:runcommand('clone', 'https://bitbucket.org/av6/lua-hglib', '/tmp/testrepo')
+local code, o, e, d = client:runcommand('log', '-l', '5', '-T', 'json', '-R', '/tmp/testrepo')
+ local data = cjson_safe.decode(o)
+ print('Last 5 commits:')
+ for _, changeset in ipairs(data) do
+ local firstline = changeset.desc:match('^[^\n]*')
+ print(changeset.rev .. '·' .. changeset.node:sub(1, 12) .. ' ' .. firstline)
+ print("Couldn't get log: " .. e)