Merge lp:~jml/launchpad/legacy-vcs-imports into lp:launchpad

Proposed by Jonathan Lange
Status: Merged
Merged at revision: not available
Proposed branch: lp:~jml/launchpad/legacy-vcs-imports
Merge into: lp:launchpad
Diff against target: None lines
To merge this branch: bzr merge lp:~jml/launchpad/legacy-vcs-imports
Reviewer Review Type Date Requested Status
Michael Hudson-Doyle Approve
Review via email: mp+10900@code.launchpad.net
To post a comment you must log in.
Revision history for this message
Jonathan Lange (jml) wrote :

This branch removes code from ProductSeries that was only used by legacy vcs-imports code. Best reviewed with https://code.edge.launchpad.net/~jml/launchpad/remove-vcs-imports/+merge/10899

Revision history for this message
Michael Hudson-Doyle (mwhudson) wrote :

Looks like something I forgot to delete about 6 months ago :)

review: Approve

Preview Diff

[H/L] Next/Prev Comment, [J/K] Next/Prev File, [N/P] Next/Prev Hunk
=== modified file 'lib/lp/registry/model/productseries.py'
--- lib/lp/registry/model/productseries.py 2009-08-24 03:18:41 +0000
+++ lib/lp/registry/model/productseries.py 2009-08-30 01:45:18 +0000
@@ -594,46 +594,6 @@
594 except SQLObjectNotFound:594 except SQLObjectNotFound:
595 return default595 return default
596596
597 def composeQueryString(self, text=None, importstatus=None):
598 """Build SQL "where" clause for `ProductSeries` search.
599
600 :param text: Text to search for in the product and project titles and
601 descriptions.
602 :param importstatus: If specified, limit the list to series which have
603 the given import status; if not specified or None, limit to series
604 with non-NULL import status.
605 """
606 conditions = ["ProductSeries.product = Product.id"]
607 if text == u'':
608 text = None
609
610 # First filter on text, if supplied.
611 if text is not None:
612 conditions.append("""
613 ((Project.fti @@ ftq(%s) AND Product.project IS NOT NULL) OR
614 Product.fti @@ ftq(%s))""" % (quote(text), quote(text)))
615
616 # Exclude deactivated products.
617 conditions.append('Product.active IS TRUE')
618
619 # Exclude deactivated projects, too.
620 conditions.append(
621 "((Product.project = Project.id AND Project.active) OR"
622 " Product.project IS NULL)")
623
624 # Now just add the filter on import status.
625 if importstatus is None:
626 conditions.append('ProductSeries.importstatus IS NOT NULL')
627 else:
628 conditions.append('ProductSeries.importstatus = %s'
629 % sqlvalues(importstatus))
630
631 # And build the query.
632 query = " AND ".join(conditions)
633 return """productseries.id IN
634 (SELECT productseries.id FROM productseries, product, project
635 WHERE %s) AND productseries.product = product.id""" % query
636
637 def getSeriesForBranches(self, branches):597 def getSeriesForBranches(self, branches):
638 """See `IProductSeriesSet`."""598 """See `IProductSeriesSet`."""
639 store = getUtility(IStoreSelector).get(MAIN_STORE, DEFAULT_FLAVOR)599 store = getUtility(IStoreSelector).get(MAIN_STORE, DEFAULT_FLAVOR)