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

Kevin Bullock kbullock+mercurial at ringworld.org
Tue Jul 9 17:32:55 CDT 2013


On 1 Jul 2013, at 2:55 PM, Alexander Plavin wrote:

> 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.

Sounds reasonable to me, but do you have a specific example?

pacem in terris / мир / शान्ति / ‎‫سَلاَم‬ / 平和
Kevin R. Bullock



More information about the Mercurial-devel mailing list