[PATCH 2 of 4] commands: add template support for version

Yuya Nishihara yuya at tcha.org
Tue Aug 9 09:54:12 EDT 2016


On Mon, 08 Aug 2016 10:54:44 -0500, Mathias De Maré wrote:
> # HG changeset patch
> # User Mathias De Maré <mathias.demare at gmail.com>
> # Date 1470113194 -7200
> #      Tue Aug 02 06:46:34 2016 +0200
> # Node ID 2a711c2a71c1e5e562fc988cfe9011ebf3d8e6e9
> # Parent  4fb94670f2a3eb0247a040f0506a2f6580e3dca9
> commands: add template support for version
> 
> Example output (lines shortened manually):
> hg version -Tjson -v
> [
>  {
>   "enabledextensions": {"purge" : {"version" : "", "place" : "internal"} },

Probably this should be a list of dicts:

  [{"name": "purge", "place": "internal", ...}, ...]

which will be referenced as "{enabledextensions % "{name} {place}"}" in
template. But, currently formatter does not provide a way to construct
a nested data structure.

>   "fullversion": "Mercurial Distributed SCM (version 3.9-rc+26-f491b3)\n",
>   "license": "(see https://mercurial-scm.org for...",

These two fields seem very different from what we generally put in JSON output.
Maybe debuginstall has some hints how to process this kind of text.

>   "version": "3.9-rc+26-f491b303946d"

We'll have to consolidate a naming rule, 'ver' vs 'version'.


More information about the Mercurial-devel mailing list