[PATCH 2 of 2] templaterfilters: add 'newline' filter

Sean Farley sean.michael.farley at gmail.com
Thu Jan 17 21:11:57 CST 2013


On Thu, Jan 17, 2013 at 12:41 PM, Matt Mackall <mpm at selenic.com> wrote:
> On Thu, 2013-01-17 at 12:36 -0600, Sean Farley wrote:
>> On Wed, Jan 9, 2013 at 2:09 PM, Matt Mackall <mpm at selenic.com> wrote:
>> > On Wed, 2013-01-09 at 12:12 -0600, Sean Farley wrote:
>> >> # HG changeset patch
>> >> # User Sean Farley <sean.michael.farley at gmail.com>
>> >> # Date 1357671975 21600
>> >> # Node ID f8098885faa0fa09c8a9cfc887d807fa3c140cf4
>> >> # Parent  e9a1700097f2e520b5b0773f902cb92fe7af99ae
>> >> templaterfilters: add 'newline' filter
>> >
>> > We've got things like if() and sub() now, so we shouldn't need to add
>> > more special-purpose filters like this.
>> >
>> > $ hg tip --template '{if(author, "{author}\n")}'
>> > Matt Mackall <mpm at selenic.com>
>>
>> That's true. I'll drop this patch series. Also, I just figured out how
>> to do 'notfirstname' with sub(). For those wondering, I was able to
>> use sub(r'^.*\n?\n?', '', desc).
>
> Feel free to add examples to the template page.

Just to make sure, you're talking about this page,

http://mercurial.selenic.com/wiki/TemplateFilters

correct?


More information about the Mercurial-devel mailing list