New stuff: -T json

Matt Mackall mpm at
Mon Sep 15 17:41:13 CDT 2014

We've finally grown some JSON output support, as described in:

Currently supported commands are log, parents, heads, incoming,
outgoing, status, manifest, tags, and the new files command:

$ hg log -r . -Tjson
  "rev": 24069,
  "node": "eaeee6f95fc07ed22acd3e62db4d241d0ee97b84",
  "branch": "default",
  "phase": "public",
  "user": "Matt Mackall <mpm at>",
  "date": [1394994548, 18000],
  "desc": "locate: deprecate in favor of files",
  "bookmarks": ["@", "files-command"],
  "tags": ["tip"],
  "parents": ["968247e8f4ac1ad90ae77ae067cf7db2c0fe4c4e"]

$ hg files -v "set:grep('set us up the BOM')" -Tjson
  "abspath": "mercurial/",
  "flags": "",
  "path": "mercurial/",
  "size": 5914

The non-log-like commands also support a "debug" format with a
Python-compatible syntax, Python's "pickle" format, and will eventually
allow our full template syntax as well.

Adding support to the other commands like branches/bookmarks/annotate is
really easy (hint hint), they just need to start using a formatter:

Mathematics is the supreme nostalgia of our time.

More information about the Mercurial-devel mailing list