Commit Graph

1 Commits

Author SHA1 Message Date
Pulkit Goyal
d3b6e1c63c fbhistedit: add support for json input to histedit
This patch adds support to histedit command to take input from json. The JSON
should be of following format:

{ "histedit": [
                {"action": "...", "node": "..."},
                {"action": "...", "command": "..."},
                {...}
              ]
}

For actions except "exec" and "execr", "node" is required and for "exec" and
"execr", "command" should be there.

The support is plugged in directly and is not hidden behind a config flag. After
this support, the parser which parses the commands file will assume that JSON is
given and will fallback to original parsing if it fails to convert the data in
the file to JSON.
In case where input is JSON but a key is missing, status message is shown and we
fallback to normal parsing.

Both small and large verbs are supported for the action part in JSON.

Differential Revision: https://phab.mercurial-scm.org/D1263
2017-11-03 05:30:12 +05:30