[PATCH stable] debugbuilddag: fix uninitialized variable

Wagner Bruna wagner.bruna+mercurial at gmail.com
Fri Mar 2 08:48:24 CST 2012


On 03/01/2012 11:45 PM, Greg Ward wrote:
> On 01 March 2012, Wagner Bruna said:
>> # HG changeset patch
>> # User Wagner Bruna <wbruna at softwareexpress.com.br>
>> # Date 1330640804 10800
>> # Branch stable
>> # Node ID 64fb7fe6abcb5bebc4a827594a903914d6335e69
>> # Parent  8ae7626d8bf1c41998bc62dbb929ae032c6ab6ff
>> debugbuilddag: fix uninitialized variable
>>
>> diff --git a/mercurial/commands.py b/mercurial/commands.py
>> --- a/mercurial/commands.py
>> +++ b/mercurial/commands.py
>> @@ -1381,7 +1381,8 @@ def debugbuilddag(ui, repo, text=None,
>>          at = -1
>>          atbranch = 'default'
>>          nodeids = []
>> -        ui.progress(_('building'), 0, unit=_('revisions'), total=total)
>> +        id = 0
>> +        ui.progress(_('building'), id, unit=_('revisions'), total=total)
> 
> ...surely this is reproducible with a test case? I mean, I *know* it
> is, I just ran your "debugbuilddag" command in issue3299 where you
> found this bug. ;-)

Indeed :)  I posted this in a hurry for 2.1.1, but missed it by a few minutes...

It's easy to spot the error once you know it's there, but I'll include a small
test case anyway.

Regards,
Wagner


More information about the Mercurial-devel mailing list