Commit Graph

5 Commits

Author SHA1 Message Date
Jun Wu
5cf10d244c template: improve error handling when template function signature mismatch
Summary:
Template function requires input arguments. They do not always exist.
If any argument is missing, just return an empty value, instead of crash.

Reviewed By: mitrandir77

Differential Revision: D8221246

fbshipit-source-id: ff3839398bdc620bff61d1b19b1512010c06388e
2018-06-06 15:43:25 -07:00
Jun Wu
47b327c175 rebase: use command-level template (BC)
Summary:
Use the command-level template and the `nodechanges` template keyword.
Drop the use of formatter.

`-Tjson` is not treated specially so it will just print `json`. If we'd like
to make it output `{"nodehcnages": ...}` (probably not a list with one
element), it's doable by having some mapping from `json` to a default
template.

Reviewed By: mitrandir77

Differential Revision: D8221076

fbshipit-source-id: 75575a98324d0d069789e0e915d5aa282ca0d4bb
2018-06-06 15:43:25 -07:00
Pulkit Goyal
04f1e48a0d rebase: use fm.formatlist() and fm.formatdict() to support user template
Thanks to Yuya for suggesting this in D1173.

Differential Revision: https://phab.mercurial-scm.org/D1293
2017-10-28 17:50:25 +05:30
Pulkit Goyal
b286a1df01 tests: add test for rebase template showing wrong behavior
The output for template "{nodechanges % '{key}:{value}'}" does not contain the
output for value.

Differential Revision: https://phab.mercurial-scm.org/D1462
2017-11-09 20:06:30 +05:30
Pulkit Goyal
58f03d7898 rebase: add support to output nodechanges
This patch adds support to rebase to show the changes in node once the rebase is
complete. This will be extremely helpful for automation purposes and editors
such as Nuclide.

The output is a dictionary of predecessor hash as key and a list of successors'
hashes. The successors one is a list as there can be many successors for a single
predecessor in case of split and it will good to have a generic output format.

This patch adds tests for the same. A new file is created for the patch as
existing files related to rebase has their own purpose and there will be more
formatter support coming for rebase in next cycle.

Thanks to Jun for suggesting to use fm.data().

Differential Revision: https://phab.mercurial-scm.org/D1173
2017-10-18 04:31:46 +05:30