~launchpad-pqm/launchpad/devel

« back to all changes in this revision

Viewing changes to lib/lp/registry/model/sourcepackage.py

  • Committer: Gary Poster
  • Date: 2009-04-20 12:43:08 UTC
  • mfrom: (8255 devel)
  • mto: (8329.1.1 buildout2)
  • mto: This revision was merged to the branch mainline in revision 8489.
  • Revision ID: gary.poster@canonical.com-20090420124308-k2tahh982si8upvy
merge from trunk

Show diffs side-by-side

added added

removed removed

Lines of Context:
1
 
# Copyright 2004-2007 Canonical Ltd.  All rights reserved.
 
1
# Copyright 2004-2009 Canonical Ltd.  All rights reserved.
2
2
# pylint: disable-msg=E0611,W0212
3
3
"""Database classes that implement SourcePacakge items."""
4
4
 
48
48
from canonical.launchpad.interfaces.potemplate import IHasTranslationTemplates
49
49
from canonical.launchpad.interfaces.publishing import (
50
50
    PackagePublishingPocket, PackagePublishingStatus)
51
 
from lp.answers.interfaces.questioncollection import QUESTION_STATUS_DEFAULT_SEARCH
 
51
from lp.answers.interfaces.questioncollection import (
 
52
    QUESTION_STATUS_DEFAULT_SEARCH)
52
53
from lp.answers.interfaces.questiontarget import IQuestionTarget
53
54
from lp.code.interfaces.seriessourcepackagebranch import (
54
 
    ISeriesSourcePackageBranchSet)
 
55
    IMakeOfficialBranchLinks)
55
56
from lp.registry.interfaces.sourcepackage import (
56
57
    ISourcePackage, ISourcePackageFactory)
57
58
 
618
619
 
619
620
    def setBranch(self, pocket, branch, registrant):
620
621
        """See `ISourcePackage`."""
621
 
        getUtility(ISeriesSourcePackageBranchSet).new(
622
 
            self.distroseries, pocket, self.sourcepackagename, branch,
623
 
            registrant)
 
622
        series_set = getUtility(IMakeOfficialBranchLinks)
 
623
        series_set.delete(self, pocket)
 
624
        if branch is not None:
 
625
            series_set.new(
 
626
                self.distroseries, pocket, self.sourcepackagename, branch,
 
627
                registrant)
624
628
 
625
629
    @property
626
630
    def linked_branches(self):