bugzilla2trac.py: Components / Versions from too many bugzilla products get imported
|Reported by:||Owned by:||Remy Blank|
Selecting multiple PRODUCTS and COMPONENTS_FROM_PRODUCTS = False converts too many components from Bugzilla to Trac.
Software versions I use:
- Python: 2.3.4
- Bugzilla: 3.0.2
- Mysql: 4.0.18
- Trac: 0.10.4
- bugzilla2trac.py: revision 8272
- MySQL-python: 1.2.1_p2
My setup (partial):
COMPONENTS_FROM_PRODUCTS = False PRODUCTS = ["Product1","Product2","Product3"]
This results in the conversion of too many components: also components NOT belonging to Product1, Product2 or Product3 get imported.
By printing the select clause for components (line 570) I found out the issue is with the generated where clause for components: line 574:
sql += makeWhereClause('p.name', PRODUCTS)
This results in a where clause in the following form
p.name = 'Product1' or p.name = 'Product2' or p.name = 'Product3'
However, there are not parentheses around this where clause, which results in too many components getting selected.
I think any where clause generated by makeWhereClause(…) should result in a where clause surrounded by parentheses.
I fixed the problem by modifying line 498 in the makeWhereClause function: from
return ' ' + clause
return ' (' + clause + ') '
Can someone please review this change and (if accepted) apply it to bugzilla2trac.py?
Change History (6)
comment:1 by , 13 years ago
|Summary:||bugzilla2trac.py: Components from too many bugzilla products get imported → bugzilla2trac.py: Components / Versions from too many bugzilla products get imported|