[BUG] hg log -v crashes

Maxim Dounin mdounin at mdounin.ru
Mon Feb 11 07:19:06 CST 2008


Hello!

On Mon, Feb 11, 2008 at 12:55:01PM +0100, Guido Ostkamp wrote:

>Hello,
>
>On Mon, 11 Feb 2008 12:07:13 +0100, "Guido Ostkamp"
><hg at ostkamp.fastmail.fm> said:
>> Hello,
>> 
>> the 'hg log -v' command crashes here:
>
>I would like to add that I use my own .hg_style file which
>worked ok with older versions of Mercurial 
>(e.g. Mercurial Distributed SCM (version 3aa5c45874c6+20071105)).
>
>In .hgrc I have
>
>[ui]
>style = /home/ostkamp/.hg_style
>
>And in .hg_style (sorry, in case the line wrapping fails):
>
>changeset = 'changeset:  
>{rev}:{node|short}\n{branches}{tags}{parents}user:       
>{author}\ndate:        {date|date}\nsummary:     {desc|firstline}\n\n'
>changeset_quiet = '{rev}:{node|short}\n'
>changeset_verbose = 'changeset:  
>{rev}:{node|short}\n{branches}{tags}{parents}{manifest}user:       
>{author}\ndate:       
>{date|date}\n{files}{file_adds|strip|fill76}{file_dels|strip|fill76}{file_copies}description:\n{desc|strip}\n\n\n'

Reduced tescase:

hg log --template '{file_adds|strip}' -l1

And backtrace is reproducable with older versions too, but you 
have to specify --debug for this, since no file_adds exposed 
without --debug before 5a124ce4602a.

The problem is that 'strip' (and 'fill76' too, actually) only 
applicable to strings, while file_adds is a list. You should use 
'stringify' if you really need to do something with list as 
string, e.g.:

hg log --template '{file_adds|stringify|strip|fill76}' -l1

Maxim Dounin


More information about the Mercurial mailing list