[PATCH 5 of 9 V4] template: compute verb in obsfateverb
Yuya Nishihara
yuya at tcha.org
Fri Aug 25 13:57:18 UTC 2017
On Wed, 23 Aug 2017 17:18:39 +0200, Boris Feld wrote:
> # HG changeset patch
> # User Boris Feld <boris.feld at octobus.net>
> # Date 1499088807 -7200
> # Mon Jul 03 15:33:27 2017 +0200
> # Node ID 8c1da4748240142e1ee62521279cf8556192c79e
> # Parent c2702967b47010d10ee0b8cf9ee633928d4b6214
> # EXP-Topic obsfatetemplate
> template: compute verb in obsfateverb
> +def _successorsetverb(successorset):
^^^
Nit: drop '_' ?
> + """ Return the verb summarizing the successorset
> + """
> + if not successorset:
> + verb = 'pruned'
> + elif len(successorset) == 1:
> + verb = 'rewritten'
> + else:
> + verb = 'split'
> + return verb
> + at templatefunc('obsfateverb(successors)')
> +def obsfateverb(context, mapping, args):
> + """ Compute obsfate related information based on successors
> +
> + (EXPERIMENTAL)
> + """
> + if not len(args) == 1:
Nit: != 1
> + # i18n: "obsfateverb" is a keyword
> + raise error.ParseError(_("obsfateverb expects one arguments"))
> +
> + successors = evalfuncarg(context, mapping, args[0])
> + if not isinstance(successors, collections.Iterable):
Nit: iterable doesn't mean it is countable.
More information about the Mercurial-devel
mailing list