[PATCH 2 of 2] templater: add nonempty function with an extra argument placeholder

Alexander Plavin me at aplavin.ru
Mon Jul 1 14:55:14 CDT 2013


2013/7/1 Matt Mackall <mpm at selenic.com>:
> On Sat, 2013-06-29 at 18:02 +0400, Alexander Plavin wrote:
>> # HG changeset patch
>> # User Alexander Plavin <me at aplavin.ru>
>> # Date 1372502211 -14400
>> #      Sat Jun 29 14:36:51 2013 +0400
>> # Node ID 7e93df87bd7b380bb27c3812285e215774602352
>> # Parent  7b9b339fa1ccb512aa220dbdf0c651c28d469317
>> templater: add nonempty function with an extra argument placeholder
>>
>> Behaviour without the extra argument is same as for the existing
>> nonempty filter.
>
> May I please finally call your attention to the if() function?
>

I know about a similar if() usage, but compare these ones: 'if(<very
long expression>, <very long expression (again the same!)>,
placeholder)' with 'nonempty(<very long expression>, placeholder)':
the second variant doesn't need repeating the first argument.

> --
> Mathematics is the supreme nostalgia of our time.
>
>


More information about the Mercurial-devel mailing list