~launchpad-pqm/launchpad/devel

« back to all changes in this revision

Viewing changes to lib/lp/testing/factory.py

[r=allenap][bug=782105] Rename DistroSeries.parent_series to
 previous_series.

Show diffs side-by-side

added added

removed removed

Lines of Context:
2337
2337
 
2338
2338
    def makeDistroRelease(self, distribution=None, version=None,
2339
2339
                          status=SeriesStatus.DEVELOPMENT,
2340
 
                          parent_series=None, name=None, displayname=None,
 
2340
                          previous_series=None, name=None, displayname=None,
2341
2341
                          registrant=None):
2342
2342
        """Make a new distro release."""
2343
2343
        if distribution is None:
2360
2360
            displayname=displayname,
2361
2361
            title=self.getUniqueString(), summary=self.getUniqueString(),
2362
2362
            description=self.getUniqueString(),
2363
 
            parent_series=parent_series, registrant=registrant)
 
2363
            previous_series=previous_series, registrant=registrant)
2364
2364
        series.status = status
2365
2365
 
2366
2366
        return ProxyFactory(series)
2367
2367
 
2368
2368
    def makeUbuntuDistroRelease(self, version=None,
2369
2369
                                status=SeriesStatus.DEVELOPMENT,
2370
 
                                parent_series=None, name=None,
 
2370
                                previous_series=None, name=None,
2371
2371
                                displayname=None):
2372
2372
        """Short cut to use the celebrity 'ubuntu' as the distribution."""
2373
2373
        ubuntu = getUtility(ILaunchpadCelebrities).ubuntu
2374
2374
        return self.makeDistroRelease(
2375
 
            ubuntu, version, status, parent_series, name, displayname)
 
2375
            ubuntu, version, status, previous_series, name, displayname)
2376
2376
 
2377
2377
    # Most people think of distro releases as distro series.
2378
2378
    makeDistroSeries = makeDistroRelease
2388
2388
        if derived_series is None:
2389
2389
            parent_series = self.makeDistroSeries()
2390
2390
            derived_series = self.makeDistroSeries(
2391
 
                parent_series=parent_series)
 
2391
                previous_series=parent_series)
2392
2392
 
2393
2393
        if source_package_name_str is None:
2394
2394
            source_package_name_str = self.getUniqueString('src-name')
2403
2403
 
2404
2404
        base_version = versions.get('base')
2405
2405
        if base_version is not None:
2406
 
            for series in [derived_series, derived_series.parent_series]:
 
2406
            for series in [derived_series, derived_series.previous_series]:
2407
2407
                spr = self.makeSourcePackageRelease(
2408
2408
                    sourcepackagename=source_package_name,
2409
2409
                    version=base_version)
2428
2428
                version=versions.get('parent'),
2429
2429
                changelog=changelogs.get('parent'))
2430
2430
            self.makeSourcePackagePublishingHistory(
2431
 
                distroseries=derived_series.parent_series,
 
2431
                distroseries=derived_series.previous_series,
2432
2432
                sourcepackagerelease=spr,
2433
2433
                status=PackagePublishingStatus.PUBLISHED)
2434
2434