~launchpad-pqm/launchpad/devel

« back to all changes in this revision

Viewing changes to lib/lp/soyuz/model/publishing.py

[r=julian-edwards][bug=789091] Fix InitialiseDistroSeries so that it
        actually initializes a derived series from multiple parents.

Show diffs side-by-side

added added

removed removed

Lines of Context:
35
35
    Or,
36
36
    Sum,
37
37
    )
 
38
from storm.zope.interfaces import ISQLObjectResultSet
38
39
from storm.store import Store
 
40
from storm.zope import IResultSet
39
41
from zope.component import getUtility
40
42
from zope.interface import implements
41
43
from zope.security.proxy import removeSecurityProxy
1336
1338
    def copyBinariesTo(self, binaries, distroseries, pocket, archive,
1337
1339
                       policy=None):
1338
1340
        """See `IPublishingSet`."""
 
1341
        if binaries is None:
 
1342
            return
 
1343
 
 
1344
        if type(removeSecurityProxy(binaries)) == list:
 
1345
            if len(binaries) == 0:
 
1346
                return
 
1347
        else:
 
1348
            if ISQLObjectResultSet.providedBy(binaries):
 
1349
                # Adapt to ResultSet
 
1350
                binaries = IResultSet(binaries)
 
1351
            if binaries.is_empty():
 
1352
                return
 
1353
 
1339
1354
        if policy is not None:
1340
1355
            bpn_archtag = {}
1341
1356
            for bpph in binaries: