[Yum-devel] [PATCH 2/2] Change "history info" to display the last transaction, even aborted ones.

Seth Vidal skvidal at fedoraproject.org
Tue Dec 22 19:49:37 UTC 2009



On Tue, 22 Dec 2009, Seth Vidal wrote:

>
>
> On Tue, 22 Dec 2009, James Antill wrote:
>
>> @@ -1297,12 +1297,29 @@ to exit.
>>             return None
>>
>>         tids = []
>> -        try:
>> -            int(extcmds[1])
>> -            tids.append(extcmds[1])
>> -        except ValueError:
>> -            self.logger.critical(_('Bad transaction ID given'))
>> -            return None
>> +        last = None
>> +        for extcmd in extcmds[1:]:
>> +            try:
>> +                if extcmd == 'last' or extcmd.startswith('last-'):
>> +                    if last is None:
>> +                        last = self.history.last(False)
>
> don't do this                                     ^^^^^^
>
> I hate finding code with 'True' or 'False' and no idea what the hell it does 
> instead of it being a kwarg. It means when you read this code you have to go 
> chase down that function.
>
> Just put the keyword in there, too.

oh and otherwise ACK

-sv



More information about the Yum-devel mailing list