-m and -f filter is not working

Bug #89250 reported by Markus Korn
2
Affects Status Importance Assigned to Milestone
Bug Helper
Fix Released
High
Markus Korn

Bug Description

The -m and -f filter is not working since r96 of the main branch. Seems to be easy to solve, working on a patch...

Changed in bughelper:
assignee: nobody → thekorn
Revision history for this message
Pappan (ppadman) wrote :

Easily reproducible, so confirming

Changed in bughelper:
status: Unconfirmed → Confirmed
Revision history for this message
Pappan (ppadman) wrote :

Breaks functionality, marking as critical and target as 0.1 version

Changed in bughelper:
importance: Undecided → Critical
importance: Critical → High
Revision history for this message
Markus Korn (thekorn) wrote :

This patch solves this problem. -m and -f is now working. It also solves the problems with --stats in #84903.

Revision history for this message
Pappan (ppadman) wrote :

Comment 1:
========

Can we simplify this ?

+def add_dict_value(dict, key, value):
+ if not dict.has_key(key):
+ dict[key] = 0
+ dict[key] += value
+ return dict

like

+def add_dict_value(dict, key):
+ if not dict.has_key(key):
+ dict[key] = 0
+ dict[key] += 1
+ return dict

Comment 2:
========

self.bugs = filter(lambda x,b=bug: int(x)!=int(b),self.bugs)

filter() returns list if the second parameter is not a string or tuple.

Checking the type of self.bugs:

self.bugs = set()

It is a set.

So is the fix is changing self.bugs from a set to a list ?

I can see an already existing similar thing just above the change

self.bugs = filter(minFilter, self.bugs)

so from this is initializing self.bugs to set() is incorrect (this will be a new bug i guess ? )

Note: update() member function is part of set and not list. We use it in the code for self.bugs. Also is set.update deprecated in python 2.5 ?

Pappan

Revision history for this message
Markus Korn (thekorn) wrote :

Thanks a lot for your comments Pappan.
I added changed the patch to solve the two issues in your comment.

self.bugs is now a set().

Markus

Markus Korn (thekorn)
Changed in bughelper:
status: Confirmed → Fix Committed
Revision history for this message
Markus Korn (thekorn) wrote :

Version three of this patch after some code-cleaning

Revision history for this message
Daniel Holbach (dholbach) wrote :

Thanks a lot Markus.
------------------------------------------------------------
revno: 101
committer: Daniel Holbach <email address hidden>
branch nick: bughelper.main
timestamp: Mon 2007-03-05 13:45:56 +0100
message:
  Patches by Markus Korn <email address hidden> to fix bug 89726 and bug 89250
------------------------------------------------------------

Changed in bughelper:
status: Fix Committed → Fix Released
To post a comment you must log in.
This report contains Public information  
Everyone can see this information.

Other bug subscribers

Remote bug watches

Bug watches keep track of this bug in other bug trackers.