launchpad-reviewers team mailing list archive
-
launchpad-reviewers team
-
Mailing list archive
-
Message #03650
[Merge] lp:~allenap/launchpad/parent-to-previous-bug-782105-take-2 into lp:launchpad
Gavin Panella has proposed merging lp:~allenap/launchpad/parent-to-previous-bug-782105-take-2 into lp:launchpad.
Requested reviews:
Launchpad code reviewers (launchpad-reviewers)
Related bugs:
Bug #782105 in Launchpad itself: "Rename DistroSeries.parent_series to previous_series"
https://bugs.launchpad.net/launchpad/+bug/782105
For more details, see:
https://code.launchpad.net/~allenap/launchpad/parent-to-previous-bug-782105-take-2/+merge/61262
Renames DistroSeries.parent_series to previous_series. There was already a not-much-used previous_series, which has been renamed prior_series. Neither name appears in the tree now so renaming from here will be trivial. The only new code is an extra section in lib/lp/registry/stories/webservice/xx-distroseries.txt that ensures that previous_series is still known as parent_series in the beta and 1.0 webservice APIs.
--
https://code.launchpad.net/~allenap/launchpad/parent-to-previous-bug-782105-take-2/+merge/61262
Your team Launchpad code reviewers is requested to review the proposed merge of lp:~allenap/launchpad/parent-to-previous-bug-782105-take-2 into lp:launchpad.
=== modified file 'lib/canonical/launchpad/interfaces/_schema_circular_imports.py'
--- lib/canonical/launchpad/interfaces/_schema_circular_imports.py 2011-05-12 21:33:10 +0000
+++ lib/canonical/launchpad/interfaces/_schema_circular_imports.py 2011-05-17 14:41:19 +0000
@@ -481,7 +481,7 @@
IDistroSeries, 'getPackageUploads', 'archive', IArchive)
patch_collection_return_type(
IDistroSeries, 'getPackageUploads', IPackageUpload)
-patch_reference_property(IDistroSeries, 'parent_series', IDistroSeries)
+patch_reference_property(IDistroSeries, 'previous_series', IDistroSeries)
patch_plain_parameter_type(
IDistroSeries, 'deriveDistroSeries', 'distribution', IDistribution)
patch_collection_return_type(
=== modified file 'lib/lp/registry/browser/distroseries.py'
--- lib/lp/registry/browser/distroseries.py 2011-05-10 18:17:45 +0000
+++ lib/lp/registry/browser/distroseries.py 2011-05-17 14:41:19 +0000
@@ -578,7 +578,7 @@
summary=data['summary'],
description=u"",
version=data['version'],
- parent_series=None,
+ previous_series=None,
registrant=self.user)
notify(ObjectCreatedEvent(distroseries))
self.next_url = canonical_url(distroseries)
@@ -734,7 +734,7 @@
return form.Fields(Choice(
__name__='package_type',
vocabulary=make_package_type_vocabulary(
- self.context.parent_series.displayname,
+ self.context.previous_series.displayname,
self.search_higher_parent_option),
default=DEFAULT_PACKAGE_TYPE,
required=True))
@@ -903,7 +903,7 @@
# Update the label for sync action.
self.initialize_sync_label(
"Sync Selected %s Versions into %s" % (
- self.context.parent_series.displayname,
+ self.context.previous_series.displayname,
self.context.displayname,
))
super(DistroSeriesLocalDifferencesView, self).initialize()
@@ -919,8 +919,8 @@
'target="help">Read more about syncing from the parent series'
'</a>).',
self.context.displayname,
- self.context.parent_series.fullseriesname,
- self.context.parent_series.displayname)
+ self.context.previous_series.fullseriesname,
+ self.context.previous_series.displayname)
@property
def label(self):
@@ -928,7 +928,7 @@
"Source package differences between '%s' and "
"parent series '%s'" % (
self.context.displayname,
- self.context.parent_series.displayname,
+ self.context.previous_series.displayname,
))
@action(_("Update"), name="update")
@@ -967,7 +967,7 @@
"Packages that are listed here are those that have been added to "
"the specific packages %s that were used to create %s. They are "
"listed here so you can consider including them in %s.",
- self.context.parent_series.displayname,
+ self.context.previous_series.displayname,
self.context.displayname,
self.context.displayname)
@@ -975,7 +975,7 @@
def label(self):
return (
"Packages in parent series '%s' but not in '%s'" % (
- self.context.parent_series.displayname,
+ self.context.previous_series.displayname,
self.context.displayname,
))
@@ -1010,14 +1010,14 @@
"Packages that are listed here are those that have been added to "
"%s but are not yet part of the parent series %s.",
self.context.displayname,
- self.context.parent_series.displayname)
+ self.context.previous_series.displayname)
@property
def label(self):
return (
"Packages in '%s' but not in parent series '%s'" % (
self.context.displayname,
- self.context.parent_series.displayname,
+ self.context.previous_series.displayname,
))
@action(_("Update"), name="update")
=== modified file 'lib/lp/registry/browser/tests/test_distroseries.py'
--- lib/lp/registry/browser/tests/test_distroseries.py 2011-05-10 19:09:35 +0000
+++ lib/lp/registry/browser/tests/test_distroseries.py 2011-05-17 14:41:19 +0000
@@ -110,7 +110,7 @@
def _createDifferenceAndGetView(self, difference_type):
# Helper function to create a valid DSD.
distroseries = self.factory.makeDistroSeries(
- parent_series=self.factory.makeDistroSeries())
+ previous_series=self.factory.makeDistroSeries())
self.factory.makeDistroSeriesDifference(
derived_series=distroseries, difference_type=difference_type)
return create_initialized_view(distroseries, '+index')
@@ -141,7 +141,7 @@
# Helper to create DSD of the different types.
derived_series = self.factory.makeDistroSeries(
name=name,
- parent_series=self.factory.makeDistroSeries(name=parent_name))
+ previous_series=self.factory.makeDistroSeries(name=parent_name))
self.simple_user = self.factory.makePerson()
for i in range(nb_diff_versions):
diff_type = DistroSeriesDifferenceType.DIFFERENT_VERSIONS
@@ -320,7 +320,7 @@
def test_submit(self):
# When creating a new DistroSeries via DistroSeriesAddView, the title
# is set to the same as the displayname (title is, in any case,
- # deprecated), the description is left empty, and parent_series is
+ # deprecated), the description is left empty, and previous_series is
# None (DistroSeriesInitializeView takes care of setting that).
user = self.factory.makePerson()
distribution = self.factory.makeDistribution(owner=user)
@@ -340,7 +340,7 @@
self.assertEqual(u"Polished Polecat", distroseries.title)
self.assertEqual(u"Even The Register likes it.", distroseries.summary)
self.assertEqual(u"", distroseries.description)
- self.assertIs(None, distroseries.parent_series)
+ self.assertIs(None, distroseries.previous_series)
self.assertEqual(user, distroseries.owner)
@@ -430,7 +430,7 @@
# are present
login_person(self.simple_user)
derived_series = self.factory.makeDistroSeries(
- name='derilucid', parent_series=self.factory.makeDistroSeries(
+ name='derilucid', previous_series=self.factory.makeDistroSeries(
name='lucid'))
self.factory.makeDistroSeriesDifference(
derived_series=derived_series)
@@ -448,7 +448,7 @@
# differences are present
login_person(self.simple_user)
derived_series = self.factory.makeDistroSeries(
- name='derilucid', parent_series=self.factory.makeDistroSeries(
+ name='derilucid', previous_series=self.factory.makeDistroSeries(
name='lucid'))
view = create_initialized_view(
@@ -465,7 +465,7 @@
with celebrity_logged_in('admin'):
ps = self.factory.makePackageset(
packages=[ds_diff.source_package_name],
- distroseries=ds_diff.derived_series.parent_series)
+ distroseries=ds_diff.derived_series.previous_series)
with person_logged_in(self.simple_user):
view = create_initialized_view(
@@ -488,7 +488,7 @@
self.factory.makePackageset(
name=name,
packages=[ds_diff.source_package_name],
- distroseries=ds_diff.derived_series.parent_series)
+ distroseries=ds_diff.derived_series.previous_series)
with person_logged_in(self.simple_user):
view = create_initialized_view(
@@ -508,7 +508,7 @@
# count will be higher, but it should remain the same no matter how
# many differences there are.
derived_series = self.factory.makeDistroSeries(
- parent_series=self.factory.makeDistroSeries())
+ previous_series=self.factory.makeDistroSeries())
ArchivePermission(
archive=derived_series.main_archive, person=self.simple_user,
component=getUtility(IComponentSet)["main"],
@@ -626,7 +626,7 @@
# If the feature flag soyuz.derived-series-ui.enabled is not set the
# view simply redirects to the derived series.
derived_series = self.factory.makeDistroSeries(
- name='derilucid', parent_series=self.factory.makeDistroSeries(
+ name='derilucid', previous_series=self.factory.makeDistroSeries(
name='lucid'))
self.assertIs(
@@ -642,7 +642,7 @@
def test_label(self):
# The view label includes the names of both series.
derived_series = self.factory.makeDistroSeries(
- name='derilucid', parent_series=self.factory.makeDistroSeries(
+ name='derilucid', previous_series=self.factory.makeDistroSeries(
name='lucid'))
view = create_initialized_view(
@@ -657,7 +657,7 @@
# The differences attribute includes differences needing
# attention only.
derived_series = self.factory.makeDistroSeries(
- name='derilucid', parent_series=self.factory.makeDistroSeries(
+ name='derilucid', previous_series=self.factory.makeDistroSeries(
name='lucid'))
current_difference = self.factory.makeDistroSeriesDifference(
derived_series=derived_series)
@@ -674,7 +674,7 @@
def test_batch_includes_different_versions_only(self):
# The view contains differences of type DIFFERENT_VERSIONS only.
derived_series = self.factory.makeDistroSeries(
- name='derilucid', parent_series=self.factory.makeDistroSeries(
+ name='derilucid', previous_series=self.factory.makeDistroSeries(
name='lucid'))
different_versions_diff = self.factory.makeDistroSeriesDifference(
derived_series=derived_series)
@@ -692,7 +692,7 @@
def test_template_includes_help_link(self):
# The help link for popup help is included.
derived_series = self.factory.makeDistroSeries(
- name='derilucid', parent_series=self.factory.makeDistroSeries(
+ name='derilucid', previous_series=self.factory.makeDistroSeries(
name='lucid'))
set_derived_series_ui_feature_flag(self)
@@ -707,7 +707,7 @@
def test_diff_row_includes_last_comment_only(self):
# The most recent comment is rendered for each difference.
derived_series = self.factory.makeDistroSeries(
- name='derilucid', parent_series=self.factory.makeDistroSeries(
+ name='derilucid', previous_series=self.factory.makeDistroSeries(
name='lucid'))
difference = self.factory.makeDistroSeriesDifference(
derived_series=derived_series)
@@ -731,7 +731,7 @@
def test_diff_row_links_to_extra_details(self):
# The source package name links to the difference details.
derived_series = self.factory.makeDistroSeries(
- name='derilucid', parent_series=self.factory.makeDistroSeries(
+ name='derilucid', previous_series=self.factory.makeDistroSeries(
name='lucid'))
difference = self.factory.makeDistroSeriesDifference(
derived_series=derived_series)
@@ -753,7 +753,7 @@
# DSD and not the last published version (bug=745776).
package_name = 'package-1'
derived_series = self.factory.makeDistroSeries(
- name='derilucid', parent_series=self.factory.makeDistroSeries(
+ name='derilucid', previous_series=self.factory.makeDistroSeries(
name='lucid'))
versions = {
'base': u'1.0',
@@ -800,7 +800,7 @@
# if we fail to fetch the published version.
package_name = 'package-1'
derived_series = self.factory.makeDistroSeries(
- name='derilucid', parent_series=self.factory.makeDistroSeries(
+ name='derilucid', previous_series=self.factory.makeDistroSeries(
name='lucid'))
versions = {
'base': u'1.0',
@@ -845,10 +845,10 @@
def test_higher_radio_mentions_parent(self):
set_derived_series_ui_feature_flag(self)
- parent_series = self.factory.makeDistroSeries(
+ previous_series = self.factory.makeDistroSeries(
name='lucid', displayname='Lucid')
derived_series = self.factory.makeDistroSeries(
- name='derilucid', parent_series=parent_series)
+ name='derilucid', previous_series=previous_series)
self.factory.makeDistroSeriesDifference(
derived_series=derived_series,
source_package_name_str="my-src-package")
@@ -876,7 +876,7 @@
# The name_filter parameter allows filtering of packages by name.
set_derived_series_ui_feature_flag(self)
derived_series = self.factory.makeDistroSeries(
- name='derilucid', parent_series=self.factory.makeDistroSeries(
+ name='derilucid', previous_series=self.factory.makeDistroSeries(
name='lucid'))
diff1 = self.factory.makeDistroSeriesDifference(
derived_series=derived_series,
@@ -902,7 +902,7 @@
# The default filter is all non blacklisted differences.
set_derived_series_ui_feature_flag(self)
derived_series = self.factory.makeDistroSeries(
- name='derilucid', parent_series=self.factory.makeDistroSeries(
+ name='derilucid', previous_series=self.factory.makeDistroSeries(
name='lucid'))
diff1 = self.factory.makeDistroSeriesDifference(
derived_series=derived_series,
@@ -932,7 +932,7 @@
# blacklisted differences.
set_derived_series_ui_feature_flag(self)
derived_series = self.factory.makeDistroSeries(
- name='derilucid', parent_series=self.factory.makeDistroSeries(
+ name='derilucid', previous_series=self.factory.makeDistroSeries(
name='lucid'))
blacklisted_diff = self.factory.makeDistroSeriesDifference(
derived_series=derived_series,
@@ -956,7 +956,7 @@
# blacklisted differences with a child's version higher than parent's.
set_derived_series_ui_feature_flag(self)
derived_series = self.factory.makeDistroSeries(
- name='derilucid', parent_series=self.factory.makeDistroSeries(
+ name='derilucid', previous_series=self.factory.makeDistroSeries(
name='lucid'))
blacklisted_diff_higher = self.factory.makeDistroSeriesDifference(
derived_series=derived_series,
@@ -986,7 +986,7 @@
# resolved.
set_derived_series_ui_feature_flag(self)
derived_series = self.factory.makeDistroSeries(
- name='derilucid', parent_series=self.factory.makeDistroSeries(
+ name='derilucid', previous_series=self.factory.makeDistroSeries(
name='lucid'))
self.factory.makeDistroSeriesDifference(
@@ -1011,12 +1011,12 @@
difference_type=None, distribution=None):
# Helper to create a derived series with fixed names and proper
# source package format selection along with a DSD.
- parent_series = self.factory.makeDistroSeries(name='warty')
+ previous_series = self.factory.makeDistroSeries(name='warty')
if distribution == None:
distribution = self.factory.makeDistribution('deribuntu')
derived_series = self.factory.makeDistroSeries(
distribution=distribution,
- name='derilucid', parent_series=parent_series)
+ name='derilucid', previous_series=previous_series)
self._set_source_selection(derived_series)
self.factory.makeDistroSeriesDifference(
source_package_name_str=src_name,
@@ -1025,7 +1025,7 @@
sourcepackagename = self.factory.getOrMakeSourcePackageName(
src_name)
set_derived_series_ui_feature_flag(self)
- return derived_series, parent_series, sourcepackagename
+ return derived_series, previous_series, sourcepackagename
def test_canPerformSync_anon(self):
# Anonymous users cannot sync packages.
@@ -1145,7 +1145,7 @@
def test_sync_success_perm_component(self):
# A user with upload rights on the destination component
# can sync packages.
- derived_series, parent_series, sourcepackagename = self._setUpDSD(
+ derived_series, previous_series, sourcepackagename = self._setUpDSD(
'my-src-name')
person, _ = self.makePersonWithComponentPermission(
derived_series.main_archive,
@@ -1159,7 +1159,7 @@
def test_sync_error_no_perm_component(self):
# A user without upload rights on the destination component
# will get an error when he syncs packages to this component.
- derived_series, parent_series, sourcepackagename = self._setUpDSD(
+ derived_series, previous_series, sourcepackagename = self._setUpDSD(
'my-src-name')
person, another_component = self.makePersonWithComponentPermission(
derived_series.main_archive)
@@ -1205,7 +1205,7 @@
'derived': '1.0derived1',
'parent': '1.0-1',
}
- derived_series, parent_series, sourcepackagename = self._setUpDSD(
+ derived_series, previous_series, sourcepackagename = self._setUpDSD(
'my-src-name', versions=versions)
# Setup a user with upload rights.
@@ -1237,7 +1237,7 @@
'parent': '1.0-1',
}
missing = DistroSeriesDifferenceType.MISSING_FROM_DERIVED_SERIES
- derived_series, parent_series, sourcepackagename = self._setUpDSD(
+ derived_series, previous_series, sourcepackagename = self._setUpDSD(
'my-src-name', difference_type=missing, versions=versions)
person, another_component = self.makePersonWithComponentPermission(
derived_series.main_archive)
@@ -1256,7 +1256,7 @@
versions = {
'parent': '1.0-1',
}
- derived_series, parent_series, sourcepackagename = self._setUpDSD(
+ derived_series, previous_series, sourcepackagename = self._setUpDSD(
'my-src-name', versions=versions)
# Update destination series status to current and update
# daterelease.
@@ -1270,9 +1270,9 @@
person, sourcepackagename)
self._syncAndGetView(
derived_series, person, ['my-src-name'])
- parent_pub = parent_series.main_archive.getPublishedSources(
+ parent_pub = previous_series.main_archive.getPublishedSources(
name='my-src-name', version=versions['parent'],
- distroseries=parent_series).one()
+ distroseries=previous_series).one()
pub = derived_series.main_archive.getPublishedSources(
name='my-src-name', version=versions['parent'],
distroseries=derived_series).one()
@@ -1305,7 +1305,7 @@
# The view fetches the differences with type
# MISSING_FROM_DERIVED_SERIES.
derived_series = self.factory.makeDistroSeries(
- parent_series=self.factory.makeDistroSeries())
+ previous_series=self.factory.makeDistroSeries())
missing_type = DistroSeriesDifferenceType.MISSING_FROM_DERIVED_SERIES
# Missing blacklisted diff.
@@ -1329,7 +1329,7 @@
# The view is empty if there is no differences with type
# MISSING_FROM_DERIVED_SERIES.
derived_series = self.factory.makeDistroSeries(
- parent_series=self.factory.makeDistroSeries())
+ previous_series=self.factory.makeDistroSeries())
not_missing_type = DistroSeriesDifferenceType.DIFFERENT_VERSIONS
@@ -1367,7 +1367,7 @@
with celebrity_logged_in('admin'):
ps = self.factory.makePackageset(
packages=[self.ds_diff.source_package_name],
- distroseries=self.ds_diff.derived_series.parent_series)
+ distroseries=self.ds_diff.derived_series.previous_series)
with person_logged_in(self.simple_user):
view = create_initialized_view(
@@ -1390,7 +1390,7 @@
# The view fetches the differences with type
# UNIQUE_TO_DERIVED_SERIES.
derived_series = self.factory.makeDistroSeries(
- name='derilucid', parent_series=self.factory.makeDistroSeries(
+ name='derilucid', previous_series=self.factory.makeDistroSeries(
name='lucid'))
missing_type = DistroSeriesDifferenceType.UNIQUE_TO_DERIVED_SERIES
@@ -1415,7 +1415,7 @@
# The view is empty if there is no differences with type
# UNIQUE_TO_DERIVED_SERIES.
derived_series = self.factory.makeDistroSeries(
- parent_series=self.factory.makeDistroSeries())
+ previous_series=self.factory.makeDistroSeries())
not_missing_type = DistroSeriesDifferenceType.DIFFERENT_VERSIONS
=== modified file 'lib/lp/registry/configure.zcml'
--- lib/lp/registry/configure.zcml 2011-05-13 03:46:29 +0000
+++ lib/lp/registry/configure.zcml 2011-05-17 14:41:19 +0000
@@ -212,7 +212,7 @@
interface="lp.registry.interfaces.distroseries.IDistroSeriesEditRestricted"/>
<require
permission="launchpad.Admin"
- set_attributes="parent_series"/>
+ set_attributes="previous_series"/>
<require
permission="launchpad.TranslationsAdmin"
set_attributes="hide_all_translations defer_translation_imports"/>
=== modified file 'lib/lp/registry/doc/distroseries.txt'
--- lib/lp/registry/doc/distroseries.txt 2011-03-31 12:53:27 +0000
+++ lib/lp/registry/doc/distroseries.txt 2011-05-17 14:41:19 +0000
@@ -842,7 +842,7 @@
>>> yo_series = youbuntu.newSeries(
... name='island', displayname='Island', title='YouBuntu Island',
... summary='summary', description='description', version='09.07',
- ... parent_series=warty, registrant=yo_driver)
+ ... previous_series=warty, registrant=yo_driver)
>>> print yo_series.name
island
>>> print yo_series.registrant.name
@@ -858,7 +858,7 @@
>>> yo_series = youbuntu.newSeries(
... name='forest', displayname='Forest', title='YouBuntu Forest',
... summary='summary', description='description', version='09.07',
- ... parent_series=warty, registrant=youbuntu.owner)
+ ... previous_series=warty, registrant=youbuntu.owner)
>>> print yo_series.name
forest
>>> print yo_series.driver
@@ -874,7 +874,7 @@
>>> ubuntu.newSeries(
... name='finch', displayname='Finch', title='Ubuntu Finch',
... summary='summary', description='description', version='9.06',
- ... parent_series=warty, owner=ubuntu.driver)
+ ... previous_series=warty, owner=ubuntu.driver)
Traceback (most recent call last):
...
Unauthorized: ...
@@ -886,7 +886,7 @@
>>> u_series = ubuntu.newSeries(
... name='finch', displayname='Finch', title='Ubuntu Finch',
... summary='summary', description='description', version='9.06',
- ... parent_series=warty, registrant=ubuntu.owner)
+ ... previous_series=warty, registrant=ubuntu.owner)
>>> print u_series.name
finch
>>> print u_series.registrant.name
=== modified file 'lib/lp/registry/interfaces/distribution.py'
--- lib/lp/registry/interfaces/distribution.py 2011-05-12 04:18:32 +0000
+++ lib/lp/registry/interfaces/distribution.py 2011-05-17 14:41:19 +0000
@@ -124,7 +124,7 @@
"""IDistribution properties requiring launchpad.Driver permission."""
def newSeries(name, displayname, title, summary, description,
- version, parent_series, registrant):
+ version, previous_series, registrant):
"""Creates a new distroseries."""
=== modified file 'lib/lp/registry/interfaces/distroseries.py'
--- lib/lp/registry/interfaces/distroseries.py 2011-05-10 13:53:16 +0000
+++ lib/lp/registry/interfaces/distroseries.py 2011-05-17 14:41:19 +0000
@@ -233,12 +233,15 @@
description=(u"Whether or not this series is initialising."))
datereleased = exported(
Datetime(title=_("Date released")))
- parent_series = exported(
+ previous_series = exported(
ReferenceChoice(
title=_("Parent series"),
description=_("The series from which this one was branched."),
required=True, schema=Interface, # Really IDistroSeries, see below
vocabulary='DistroSeries'),
+ ("devel", dict(exported_as="previous_series")),
+ ("1.0", dict(exported_as="parent_series")),
+ ("beta", dict(exported_as="parent_series")),
readonly=True)
registrant = exported(
PublicPersonChoice(
@@ -351,8 +354,8 @@
"""))
# other properties
- previous_series = Attribute("Previous series from the same "
- "distribution.")
+ prior_series = Attribute(
+ "Prior series *by date* from the same distribution.")
main_archive = exported(
Reference(
=== modified file 'lib/lp/registry/model/distribution.py'
--- lib/lp/registry/model/distribution.py 2011-05-12 04:18:32 +0000
+++ lib/lp/registry/model/distribution.py 2011-05-17 14:41:19 +0000
@@ -601,13 +601,13 @@
ParentDistroSeries = ClassAlias(DistroSeries)
# XXX rvb 2011-04-08 bug=754750: The clause
# 'DistroSeries.distributionID!=self.id' is only required
- # because the parent_series attribute has been (mis-)used
+ # because the previous_series attribute has been (mis-)used
# to denote other relations than proper derivation
# relashionships. We should be rid of this condition once
# the bug is fixed.
ret = Store.of(self).find(
DistroSeries,
- ParentDistroSeries.id == DistroSeries.parent_seriesID,
+ ParentDistroSeries.id == DistroSeries.previous_seriesID,
ParentDistroSeries.distributionID == self.id,
DistroSeries.distributionID != self.id)
return ret.config(
@@ -1794,7 +1794,7 @@
return user.inTeam(self.owner) or user.inTeam(admins)
def newSeries(self, name, displayname, title, summary,
- description, version, parent_series, registrant):
+ description, version, previous_series, registrant):
"""See `IDistribution`."""
series = DistroSeries(
distribution=self,
@@ -1805,7 +1805,7 @@
description=description,
version=version,
status=SeriesStatus.EXPERIMENTAL,
- parent_series=parent_series,
+ previous_series=previous_series,
registrant=registrant)
if (registrant.inTeam(self.driver)
and not registrant.inTeam(self.owner)):
=== modified file 'lib/lp/registry/model/distroseries.py'
--- lib/lp/registry/model/distroseries.py 2011-05-17 00:54:46 +0000
+++ lib/lp/registry/model/distroseries.py 2011-05-17 14:41:19 +0000
@@ -223,7 +223,7 @@
dbName='releasestatus', notNull=True, schema=SeriesStatus)
date_created = UtcDateTimeCol(notNull=False, default=UTC_NOW)
datereleased = UtcDateTimeCol(notNull=False, default=None)
- parent_series = ForeignKey(
+ previous_series = ForeignKey(
dbName='parent_series', foreignKey='DistroSeries', notNull=False)
registrant = ForeignKey(
dbName='registrant', foreignKey='Person',
@@ -674,7 +674,7 @@
return result
@cachedproperty
- def previous_series(self):
+ def prior_series(self):
"""See `IDistroSeries`."""
# This property is cached because it is used intensely inside
# sourcepackage.py; avoiding regeneration reduces a lot of
@@ -789,7 +789,7 @@
"""See `IDistroSeries`."""
# XXX rvb 2011-04-11 bug=754750: This should be cleaned up once
# the bug is fixed.
- return self.parent_series is not None
+ return self.previous_series is not None
@property
def is_initialising(self):
@@ -1978,10 +1978,10 @@
child = distribution.newSeries(
name=name, displayname=displayname, title=title,
summary=summary, description=description,
- version=version, parent_series=None, registrant=user)
+ version=version, previous_series=None, registrant=user)
IStore(self).add(child)
else:
- if child.parent_series is not None:
+ if child.previous_series is not None:
raise DerivationError(
"DistroSeries %s parent series is %s, "
"but it must not be set" % (
@@ -1998,13 +1998,13 @@
"""See `IDistroSeriesPublic`."""
# XXX rvb 2011-04-08 bug=754750: The clause
# 'DistroSeries.distributionID!=self.distributionID' is only
- # required because the parent_series attribute has been
+ # required because the previous_series attribute has been
# (mis-)used to denote other relations than proper derivation
# relashionships. We should be rid of this condition once
# the bug is fixed.
results = Store.of(self).find(
DistroSeries,
- DistroSeries.parent_series==self.id,
+ DistroSeries.previous_series==self.id,
DistroSeries.distributionID!=self.distributionID)
return results.order_by(Desc(DistroSeries.date_created))
=== modified file 'lib/lp/registry/model/distroseriesdifference.py'
--- lib/lp/registry/model/distroseriesdifference.py 2011-05-17 00:54:46 +0000
+++ lib/lp/registry/model/distroseriesdifference.py 2011-05-17 14:41:19 +0000
@@ -119,7 +119,7 @@
ParentDistroSeries = ClassAlias(DistroSeries)
conditions = And(
conditions,
- ParentDistroSeries.id == DistroSeries.parent_seriesID,
+ ParentDistroSeries.id == DistroSeries.previous_seriesID,
Archive.distributionID == ParentDistroSeries.distributionID,
Archive.purpose == ArchivePurpose.PRIMARY,
)
@@ -327,7 +327,7 @@
spph = parent_source_pubs_for_release[spn_id]
cache.parent_source_package_release = (
DistroSeriesSourcePackageRelease(
- dsd.derived_series.parent_series,
+ dsd.derived_series.previous_series,
spph.sourcepackagerelease))
else:
cache.parent_source_package_release = None
@@ -384,7 +384,7 @@
"""Helper to keep source_pub/parent_source_pub DRY."""
distro_series = self.derived_series
if for_parent:
- distro_series = self.derived_series.parent_series
+ distro_series = self.derived_series.previous_series
pubs = distro_series.getPublishedSources(
self.source_package_name, include_pending=True)
@@ -399,7 +399,7 @@
def base_source_pub(self):
"""See `IDistroSeriesDifference`."""
if self.base_version is not None:
- parent = self.derived_series.parent_series
+ parent = self.derived_series.previous_series
result = parent.main_archive.getPublishedSources(
name=self.source_package_name.name,
version=self.base_version).first()
@@ -421,7 +421,7 @@
@property
def title(self):
"""See `IDistroSeriesDifference`."""
- parent_name = self.derived_series.parent_series.displayname
+ parent_name = self.derived_series.previous_series.displayname
return ("Difference between distroseries '%(parent_name)s' and "
"'%(derived_name)s' for package '%(pkg_name)s' "
"(%(parent_version)s/%(source_version)s)" % {
@@ -476,12 +476,12 @@
def getParentPackageSets(self):
"""See `IDistroSeriesDifference`."""
- has_parent_series = self.derived_series is not None and (
- self.derived_series.parent_series is not None)
- if has_parent_series:
+ has_previous_series = self.derived_series is not None and (
+ self.derived_series.previous_series is not None)
+ if has_previous_series:
return getUtility(IPackagesetSet).setsIncludingSource(
self.source_package_name,
- self.derived_series.parent_series)
+ self.derived_series.previous_series)
else:
return []
@@ -504,7 +504,7 @@
@cachedproperty
def parent_source_package_release(self):
return self._package_release(
- self.derived_series.parent_series,
+ self.derived_series.previous_series,
self.parent_source_version)
@cachedproperty
=== modified file 'lib/lp/registry/model/sourcepackage.py'
--- lib/lp/registry/model/sourcepackage.py 2011-05-12 14:55:54 +0000
+++ lib/lp/registry/model/sourcepackage.py 2011-05-17 14:41:19 +0000
@@ -422,16 +422,16 @@
# if we are an ubuntu sourcepackage, try the previous series of
# ubuntu
if self.distribution == ubuntu:
- ubuntuseries = self.distroseries.previous_series
+ ubuntuseries = self.distroseries.prior_series
if ubuntuseries:
previous_ubuntu_series = ubuntuseries[0]
sp = SourcePackage(sourcepackagename=self.sourcepackagename,
distroseries=previous_ubuntu_series)
return sp.packaging
# if we have a parent distroseries, try that
- if self.distroseries.parent_series is not None:
+ if self.distroseries.previous_series is not None:
sp = SourcePackage(sourcepackagename=self.sourcepackagename,
- distroseries=self.distroseries.parent_series)
+ distroseries=self.distroseries.previous_series)
return sp.packaging
# capitulate
return None
=== modified file 'lib/lp/registry/scripts/populate_distroseriesdiff.py'
--- lib/lp/registry/scripts/populate_distroseriesdiff.py 2011-04-27 07:42:09 +0000
+++ lib/lp/registry/scripts/populate_distroseriesdiff.py 2011-05-17 14:41:19 +0000
@@ -81,7 +81,7 @@
def compose_sql_find_differences(derived_distroseries):
"""Produce SQL that finds differences for a `DistroSeries`.
- The query compares `derived_distroseries` and its `parent_series`
+ The query compares `derived_distroseries` and its `previous_series`
and for each package whose latest `SourcePackageRelease`s in the
respective series differ, produces a tuple of:
* `SourcePackageName` id: sourcepackagename
@@ -94,7 +94,7 @@
'derived_query': compose_sql_find_latest_source_package_releases(
derived_distroseries),
'parent_query': compose_sql_find_latest_source_package_releases(
- derived_distroseries.parent_series),
+ derived_distroseries.previous_series),
}
return """
SELECT DISTINCT
@@ -213,15 +213,15 @@
def find_derived_series():
"""Find all derived `DistroSeries`.
- Derived `DistroSeries` are ones that have a `parent_series`, but
- where the `parent_series` is not in the same distribution.
+ Derived `DistroSeries` are ones that have a `previous_series`, but
+ where the `previous_series` is not in the same distribution.
"""
Parent = ClassAlias(DistroSeries, "Parent")
return IStore(DistroSeries).find(
DistroSeries,
- Parent.id == DistroSeries.parent_seriesID,
+ Parent.id == DistroSeries.previous_seriesID,
Parent.distributionID != DistroSeries.distributionID).order_by(
- (DistroSeries.parent_seriesID, DistroSeries.id))
+ (DistroSeries.previous_seriesID, DistroSeries.id))
class DSDUpdater(TunableLoop):
@@ -310,7 +310,7 @@
raise OptionValueError(
"Could not find %s series %s." % (
self.options.distribution, self.options.series))
- if series.parent_series is None:
+ if series.previous_series is None:
raise OptionValueError(
"%s series %s is not derived." % (
self.options.distribution, self.options.series))
=== modified file 'lib/lp/registry/scripts/tests/test_populate_distroseriesdiff.py'
--- lib/lp/registry/scripts/tests/test_populate_distroseriesdiff.py 2011-04-27 06:41:58 +0000
+++ lib/lp/registry/scripts/tests/test_populate_distroseriesdiff.py 2011-05-17 14:41:19 +0000
@@ -89,7 +89,7 @@
def makeDerivedDistroSeries(self):
"""Create a `DistroSeries` that's derived from another distro."""
return self.factory.makeDistroSeries(
- parent_series=self.factory.makeDistroSeries())
+ previous_series=self.factory.makeDistroSeries())
def getDistroSeriesDiff(self, distroseries):
"""Find the `DistroSeriesDifference` records for `distroseries`."""
@@ -228,8 +228,8 @@
def test_does_not_find_grandparents_packages(self):
parent = self.makeDerivedDistroSeries()
- distroseries = self.factory.makeDistroSeries(parent_series=parent)
- self.makeSPPH(distroseries=parent.parent_series)
+ distroseries = self.factory.makeDistroSeries(previous_series=parent)
+ self.makeSPPH(distroseries=parent.previous_series)
query = compose_sql_find_differences(distroseries)
self.assertContentEqual([], Store.of(distroseries).execute(query))
@@ -237,7 +237,7 @@
distroseries = self.makeDerivedDistroSeries()
spr = self.factory.makeSourcePackageRelease()
self.makeSPPH(
- distroseries=distroseries.parent_series, sourcepackagerelease=spr)
+ distroseries=distroseries.previous_series, sourcepackagerelease=spr)
self.makeSPPH(
distroseries=distroseries, sourcepackagerelease=spr)
query = compose_sql_find_differences(distroseries)
@@ -246,7 +246,7 @@
def test_ignores_releases_for_same_version(self):
derived_series = self.makeDerivedDistroSeries()
version_string = self.factory.getUniqueString()
- parent_series = derived_series.parent_series
+ previous_series = derived_series.previous_series
package = self.factory.makeSourcePackageName()
self.makeSPPH(
distroseries=derived_series,
@@ -254,16 +254,16 @@
sourcepackagename=package, distroseries=derived_series,
version=version_string))
self.makeSPPH(
- distroseries=parent_series,
+ distroseries=previous_series,
sourcepackagerelease=self.factory.makeSourcePackageRelease(
- sourcepackagename=package, distroseries=parent_series,
+ sourcepackagename=package, distroseries=previous_series,
version=version_string))
query = compose_sql_find_differences(derived_series)
self.assertContentEqual([], Store.of(derived_series).execute(query))
def test_finds_release_missing_in_derived_series(self):
distroseries = self.makeDerivedDistroSeries()
- spph = self.makeSPPH(distroseries=distroseries.parent_series)
+ spph = self.makeSPPH(distroseries=distroseries.previous_series)
query = compose_sql_find_differences(distroseries)
self.assertContentEqual(
[(
@@ -287,7 +287,7 @@
def test_does_not_conflate_releases_of_different_packages(self):
distroseries = self.makeDerivedDistroSeries()
- parent_spph = self.makeSPPH(distroseries=distroseries.parent_series)
+ parent_spph = self.makeSPPH(distroseries=distroseries.previous_series)
derived_spph = self.makeSPPH(distroseries=distroseries)
query = compose_sql_find_differences(distroseries)
self.assertEqual(2, Store.of(distroseries).execute(query).rowcount)
@@ -304,12 +304,12 @@
def test_finds_different_releases_of_same_package(self):
distroseries = self.makeDerivedDistroSeries()
- parent_series = distroseries.parent_series
+ previous_series = distroseries.previous_series
spn = self.factory.makeSourcePackageName()
parent_spph = self.makeSPPH(
- distroseries=parent_series,
+ distroseries=previous_series,
sourcepackagerelease=self.factory.makeSourcePackageRelease(
- distroseries=parent_series, sourcepackagename=spn))
+ distroseries=previous_series, sourcepackagename=spn))
derived_spph = self.makeSPPH(
distroseries=distroseries,
sourcepackagerelease=self.factory.makeSourcePackageRelease(
@@ -325,12 +325,12 @@
def test_finds_newer_release_even_when_same_release_also_exists(self):
derived_series = self.makeDerivedDistroSeries()
- parent_series = derived_series.parent_series
+ previous_series = derived_series.previous_series
spn = self.factory.makeSourcePackageName()
shared_spr = self.factory.makeSourcePackageRelease(
- distroseries=parent_series, sourcepackagename=spn)
+ distroseries=previous_series, sourcepackagename=spn)
parent_spph = self.makeSPPH(
- distroseries=parent_series,
+ distroseries=previous_series,
sourcepackagerelease=shared_spr)
derived_spph = self.makeSPPH(
distroseries=derived_series,
@@ -411,10 +411,10 @@
self.assertIn(self.makeDerivedDistroSeries(), find_derived_series())
def test_ignores_parent_within_same_distro(self):
- parent_series = self.factory.makeDistroSeries()
+ previous_series = self.factory.makeDistroSeries()
derived_series = self.factory.makeDistroSeries(
- distribution=parent_series.distribution,
- parent_series=parent_series)
+ distribution=previous_series.distribution,
+ previous_series=previous_series)
self.assertNotIn(derived_series, find_derived_series())
@@ -610,10 +610,10 @@
distroseries=distroseries,
sourcepackagerelease=derived_spr)
parent_spr = self.factory.makeSourcePackageRelease(
- distroseries=distroseries.parent_series,
+ distroseries=distroseries.previous_series,
sourcepackagename=package)
self.makeSPPH(
- distroseries=distroseries.parent_series,
+ distroseries=distroseries.previous_series,
sourcepackagerelease=parent_spr)
script = self.makeScript([
'--distribution', distroseries.distribution.name,
=== modified file 'lib/lp/registry/stories/webservice/xx-derivedistroseries.txt'
--- lib/lp/registry/stories/webservice/xx-derivedistroseries.txt 2011-05-10 22:03:44 +0000
+++ lib/lp/registry/stories/webservice/xx-derivedistroseries.txt 2011-05-17 14:41:19 +0000
@@ -16,11 +16,11 @@
>>> login(ADMIN_EMAIL)
>>> soyuz_team = factory.makeTeam(name='soyuz-team')
- >>> parent_series = factory.makeDistroSeries(name="parentseries")
- >>> parent_series.driver = soyuz_team
+ >>> previous_series = factory.makeDistroSeries(name="parentseries")
+ >>> previous_series.driver = soyuz_team
>>> child_series = factory.makeDistroSeries(name='child1')
>>> child_series_with_parent = factory.makeDistroSeries(
- ... name='child-with-parent', parent_series=parent_series)
+ ... name='child-with-parent', previous_series=previous_series)
>>> other_series = factory.makeDistroSeries(name="otherseries")
>>> other_series.driver = soyuz_team
@@ -65,11 +65,11 @@
If we call it correctly, it works.
- >>> ws_parent_series = ws_object(soyuz_team_webservice, parent_series)
+ >>> ws_previous_series = ws_object(soyuz_team_webservice, previous_series)
>>> ws_child_series = ws_object(soyuz_team_webservice, child_series)
>>> print soyuz_team_webservice.named_post(
- ... ws_parent_series['self_link'], 'deriveDistroSeries', {},
+ ... ws_previous_series['self_link'], 'deriveDistroSeries', {},
... name=ws_child_series['name'],
... distribution=ws_child_series['distribution_link'],
... rebuild=False)
@@ -80,7 +80,7 @@
>>> text = 'The Second Child'
>>> print soyuz_team_webservice.named_post(
- ... ws_parent_series['self_link'], 'deriveDistroSeries', {},
+ ... ws_previous_series['self_link'], 'deriveDistroSeries', {},
... name='child2', distribution=ws_distribution['self_link'],
... displayname=text, title=text, summary=text,
... description=text, version=version,
=== modified file 'lib/lp/registry/stories/webservice/xx-distroseries.txt'
--- lib/lp/registry/stories/webservice/xx-distroseries.txt 2011-03-31 12:53:27 +0000
+++ lib/lp/registry/stories/webservice/xx-distroseries.txt 2011-05-17 14:41:19 +0000
@@ -89,6 +89,34 @@
web_link: u'http://launchpad.../ubuntu/hoary'
+Getting the previous series
+---------------------------
+
+In the beta version of the API the previous series is obtained via
+parent_series_link:
+
+ >>> current_series_beta = webservice.get(
+ ... "/ubuntu/hoary", api_version="beta").jsonBody()
+ >>> current_series_beta["parent_series_link"]
+ u'http://.../ubuntu/warty'
+
+In the 1.0 version of the API the previous series is obtained via
+parent_series_link:
+
+ >>> current_series_1_0 = webservice.get(
+ ... "/ubuntu/hoary", api_version="1.0").jsonBody()
+ >>> current_series_1_0["parent_series_link"]
+ u'http://.../ubuntu/warty'
+
+In the devel version of the API the previous series is obtained via
+parent_series_link:
+
+ >>> current_series_devel = webservice.get(
+ ... "/ubuntu/hoary", api_version="devel").jsonBody()
+ >>> current_series_devel["previous_series_link"]
+ u'http://.../ubuntu/warty'
+
+
Creating a milestone on the distroseries
----------------------------------------
=== modified file 'lib/lp/registry/templates/distribution-derivatives.pt'
--- lib/lp/registry/templates/distribution-derivatives.pt 2011-04-08 11:00:16 +0000
+++ lib/lp/registry/templates/distribution-derivatives.pt 2011-05-17 14:41:19 +0000
@@ -15,8 +15,8 @@
“<tal:codename replace="derivative/displayname" />” series
</a>
</strong>
- (from <a tal:attributes="href derivative/parent_series/fmt:url"
- tal:content="derivative/parent_series/displayname" />)
+ (from <a tal:attributes="href derivative/previous_series/fmt:url"
+ tal:content="derivative/previous_series/displayname" />)
<br/>
</li>
</tal:per_series>
=== modified file 'lib/lp/registry/templates/distribution-series.pt'
--- lib/lp/registry/templates/distribution-series.pt 2011-04-08 07:43:39 +0000
+++ lib/lp/registry/templates/distribution-series.pt 2011-05-17 14:41:19 +0000
@@ -28,12 +28,12 @@
<strong><a tal:attributes="href series/fmt:url"
tal:content="series/named_version" /></strong>
<em><span tal:replace="series/status/title" /></em>
- <tal:derives condition="series/parent_series">
+ <tal:derives condition="series/previous_series">
<br />Derives from
- <a tal:attributes="href series/parent_series/fmt:url">
+ <a tal:attributes="href series/previous_series/fmt:url">
<tal:distro
- replace="series/parent_series/distribution/displayname" />
- <tal:distroseries replace="series/parent_series/named_version" /></a>
+ replace="series/previous_series/distribution/displayname" />
+ <tal:distroseries replace="series/previous_series/named_version" /></a>
</tal:derives>
<tal:milestones
define="milestones series/all_milestones"
=== modified file 'lib/lp/registry/templates/distroseries-details.pt'
--- lib/lp/registry/templates/distroseries-details.pt 2011-04-11 00:45:29 +0000
+++ lib/lp/registry/templates/distroseries-details.pt 2011-05-17 14:41:19 +0000
@@ -50,10 +50,10 @@
<dt>Derives from:</dt>
<dd>
<a
- tal:condition="context/parent_series"
- tal:attributes="href context/parent_series/fmt:url"
- tal:content="context/parent_series/named_version" />
- <tal:none condition="not: context/parent_series">
+ tal:condition="context/previous_series"
+ tal:attributes="href context/previous_series/fmt:url"
+ tal:content="context/previous_series/named_version" />
+ <tal:none condition="not: context/previous_series">
<tal:name replace="context/named_version"/> is not derived from
another series.
</tal:none>
=== modified file 'lib/lp/registry/templates/distroseries-localdifferences.pt'
--- lib/lp/registry/templates/distroseries-localdifferences.pt 2011-05-05 13:01:50 +0000
+++ lib/lp/registry/templates/distroseries-localdifferences.pt 2011-05-17 14:41:19 +0000
@@ -23,7 +23,7 @@
<div class="top-portlet" metal:fill-slot="main"
tal:define="differences view/cached_differences;
series_name context/displayname;
- parent_name context/parent_series/displayname;
+ parent_name context/previous_series/displayname;
can_perform_sync view/canPerformSync;">
<p><tal:replace replace="structure view/explanation/escapedtext" /></p>
=== modified file 'lib/lp/registry/templates/distroseries-portlet-derivation.pt'
--- lib/lp/registry/templates/distroseries-portlet-derivation.pt 2011-04-22 10:48:57 +0000
+++ lib/lp/registry/templates/distroseries-portlet-derivation.pt 2011-05-17 14:41:19 +0000
@@ -6,7 +6,7 @@
tal:define="overview_menu context/menu:overview">
<tal:is_derived condition="context/is_derived_series">
<tal:is_initialised condition="not: context/is_initialising">
- <h2>Derived from <tal:name replace="context/parent_series/displayname"/></h2>
+ <h2>Derived from <tal:name replace="context/previous_series/displayname"/></h2>
<tal:diffs define="nb_diffs view/num_differences;
nb_diffs_in_parent view/num_differences_in_parent;
@@ -28,7 +28,7 @@
<tal:nb_diffs replace="nb_diffs_in_parent"/> package<tal:plural
content="string:s"
condition="python:nb_diffs_in_parent!=1"/> only in <tal:replace
- replace="context/parent_series/displayname">Sid</tal:replace>
+ replace="context/previous_series/displayname">Sid</tal:replace>
</a>
</li>
<li tal:condition="nb_diffs_in_child">
=== modified file 'lib/lp/registry/templates/distroseriesdifference-listing-extra.pt'
--- lib/lp/registry/templates/distroseriesdifference-listing-extra.pt 2011-04-20 09:23:44 +0000
+++ lib/lp/registry/templates/distroseriesdifference-listing-extra.pt 2011-05-17 14:41:19 +0000
@@ -14,7 +14,7 @@
<metal:macro-parent metal:define-macro="base-to-parent">
<span tal:replace="context/base_version">1.1.1</span> to
- <span tal:replace="context/derived_series/parent_series/displayname">
+ <span tal:replace="context/derived_series/previous_series/displayname">
Lucid</span> version:
<span tal:replace="context/parent_source_version">1.2.4</span>
</metal:macro-parent>
=== modified file 'lib/lp/registry/tests/test_derivedistroseries.py'
--- lib/lp/registry/tests/test_derivedistroseries.py 2011-05-10 14:07:43 +0000
+++ lib/lp/registry/tests/test_derivedistroseries.py 2011-05-17 14:41:19 +0000
@@ -52,7 +52,7 @@
def test_parent_is_not_set(self):
# When parent_series is set it means that the distroseries has already
# been derived, and it is forbidden to derive more than once.
- removeSecurityProxy(self.child).parent_series = self.parent
+ removeSecurityProxy(self.child).previous_series = self.parent
self.assertRaisesWithContent(
DerivationError,
("DistroSeries {self.child.name} parent series is "
=== modified file 'lib/lp/registry/tests/test_distribution.py'
--- lib/lp/registry/tests/test_distribution.py 2011-04-08 15:44:02 +0000
+++ lib/lp/registry/tests/test_distribution.py 2011-05-17 14:41:19 +0000
@@ -108,7 +108,7 @@
# Cache cleared.
distribution.newSeries(
name='bar', displayname='Bar', title='Bar', summary='',
- description='', version='1', parent_series=None,
+ description='', version='1', previous_series=None,
registrant=self.factory.makePerson())
self.assertNotIn("series", cache)
@@ -169,11 +169,11 @@
def test_derivatives(self):
distro1 = self.factory.makeDistribution()
distro2 = self.factory.makeDistribution()
- parent_series = self.factory.makeDistroRelease(
+ previous_series = self.factory.makeDistroRelease(
distribution=distro1)
series = self.factory.makeDistroRelease(
distribution=distro2,
- parent_series=parent_series)
+ previous_series=previous_series)
self.assertContentEqual(
[series], distro1.derivatives)
=== modified file 'lib/lp/registry/tests/test_distroseries.py'
--- lib/lp/registry/tests/test_distroseries.py 2011-04-13 09:55:48 +0000
+++ lib/lp/registry/tests/test_distroseries.py 2011-05-17 14:41:19 +0000
@@ -210,9 +210,9 @@
def test_getDerivedSeries(self):
distroseries = self.factory.makeDistroSeries(
- parent_series=self.factory.makeDistroSeries())
+ previous_series=self.factory.makeDistroSeries())
self.assertContentEqual(
- [distroseries], distroseries.parent_series.getDerivedSeries())
+ [distroseries], distroseries.previous_series.getDerivedSeries())
def test_registrant_owner_differ(self):
# The registrant is the creator whereas the owner is the
@@ -224,9 +224,9 @@
self.assertNotEqual(distroseries.registrant, distroseries.owner)
def test_is_derived(self):
- # The series is a derived series if it has a parent_series set.
+ # The series is a derived series if it has a previous_series set.
derived_distroseries = self.factory.makeDistroRelease(
- parent_series=self.factory.makeDistroRelease())
+ previous_series=self.factory.makeDistroRelease())
distroseries = self.factory.makeDistroRelease()
self.assertFalse(distroseries.is_derived_series)
self.assertTrue(derived_distroseries.is_derived_series)
=== modified file 'lib/lp/registry/tests/test_distroseries_vocabularies.py'
--- lib/lp/registry/tests/test_distroseries_vocabularies.py 2011-03-14 15:01:25 +0000
+++ lib/lp/registry/tests/test_distroseries_vocabularies.py 2011-05-17 14:41:19 +0000
@@ -77,7 +77,7 @@
self.factory.makeDistroSeries(
distribution=parent_distroseries.distribution)
distroseries = self.factory.makeDistroSeries(
- parent_series=parent_distroseries)
+ previous_series=parent_distroseries)
vocabulary = self.vocabulary_factory(distroseries)
expected_distroseries = set(parent_distroseries.distribution.series)
observed_distroseries = set(term.value for term in vocabulary)
@@ -91,7 +91,7 @@
parent_distroseries = self.factory.makeDistroSeries()
distroseries = self.factory.makeDistroSeries(
distribution=parent_distroseries.distribution,
- parent_series=parent_distroseries)
+ previous_series=parent_distroseries)
vocabulary = self.vocabulary_factory(distroseries)
expected_distroseries = (
set(self.all_distroseries).difference(
@@ -171,7 +171,7 @@
distribution = self.factory.makeDistribution()
parent_distroseries = self.factory.makeDistroSeries()
distroseries = self.factory.makeDistroSeries(
- parent_series=parent_distroseries,
+ previous_series=parent_distroseries,
distribution=distribution)
flush_database_caches()
# Reload distroseries and distribution; these will reasonably already
=== modified file 'lib/lp/registry/tests/test_distroseriesdifference.py'
--- lib/lp/registry/tests/test_distroseriesdifference.py 2011-04-21 16:11:51 +0000
+++ lib/lp/registry/tests/test_distroseriesdifference.py 2011-05-17 14:41:19 +0000
@@ -111,7 +111,7 @@
self.assertEqual(
'foonew', ds_diff.parent_source_pub.source_package_name)
self.assertEqual(
- ds_diff.derived_series.parent_series,
+ ds_diff.derived_series.previous_series,
ds_diff.parent_source_pub.distroseries)
def test_parent_source_pub_gets_latest_pending(self):
@@ -120,7 +120,7 @@
source_package_name_str="foonew")
pending_pub = self.factory.makeSourcePackagePublishingHistory(
sourcepackagename=ds_diff.source_package_name,
- distroseries=ds_diff.derived_series.parent_series,
+ distroseries=ds_diff.derived_series.previous_series,
status=PackagePublishingStatus.PENDING)
self.assertEqual(pending_pub, ds_diff.parent_source_pub)
@@ -197,7 +197,7 @@
version='1.4')
new_parent_pub = self.factory.makeSourcePackagePublishingHistory(
sourcepackagename=ds_diff.source_package_name,
- distroseries=ds_diff.derived_series.parent_series,
+ distroseries=ds_diff.derived_series.previous_series,
status=PackagePublishingStatus.PENDING,
version='1.4')
@@ -269,7 +269,7 @@
DistroSeriesDifferenceType.UNIQUE_TO_DERIVED_SERIES))
new_parent_pub = self.factory.makeSourcePackagePublishingHistory(
sourcepackagename=ds_diff.source_package_name,
- distroseries=ds_diff.derived_series.parent_series,
+ distroseries=ds_diff.derived_series.previous_series,
status=PackagePublishingStatus.PENDING,
version='1.1')
@@ -331,9 +331,9 @@
def test_title(self):
# The title is a friendly description of the difference.
- parent_series = self.factory.makeDistroSeries(name="lucid")
+ previous_series = self.factory.makeDistroSeries(name="lucid")
derived_series = self.factory.makeDistroSeries(
- parent_series=parent_series, name="derilucid")
+ previous_series=previous_series, name="derilucid")
ds_diff = self.factory.makeDistroSeriesDifference(
source_package_name_str="foonew", derived_series=derived_series,
versions={
@@ -413,7 +413,7 @@
# All parent's packagesets are returned ordered alphabetically.
ds_diff = self.factory.makeDistroSeriesDifference()
packagesets = self._setupPackageSets(
- ds_diff, ds_diff.derived_series.parent_series, 5)
+ ds_diff, ds_diff.derived_series.previous_series, 5)
parent_packagesets = ds_diff.getParentPackageSets()
self.assertEquals(
sorted([packageset.name for packageset in packagesets]),
@@ -509,7 +509,7 @@
# The attribute is set to None if there is no common base version.
# Publish different versions in the series.
derived_series = self.factory.makeDistroSeries(
- parent_series=self.factory.makeDistroSeries())
+ previous_series=self.factory.makeDistroSeries())
source_package_name = self.factory.getOrMakeSourcePackageName('foo')
self.factory.makeSourcePackagePublishingHistory(
distroseries=derived_series,
@@ -517,7 +517,7 @@
sourcepackagename=source_package_name,
status=PackagePublishingStatus.PUBLISHED)
self.factory.makeSourcePackagePublishingHistory(
- distroseries=derived_series.parent_series,
+ distroseries=derived_series.previous_series,
version='1.0ubu2',
sourcepackagename=source_package_name,
status=PackagePublishingStatus.PUBLISHED)
@@ -528,7 +528,7 @@
def test_base_version_multiple(self):
# The latest common base version is set as the base-version.
derived_series = self.factory.makeDistroSeries(
- parent_series=self.factory.makeDistroSeries())
+ previous_series=self.factory.makeDistroSeries())
source_package_name = self.factory.getOrMakeSourcePackageName('foo')
# Create changelogs for both.
changelog_lfa = self.factory.makeChangelog('foo', ['1.2', '1.1'])
@@ -551,7 +551,7 @@
# If the maximum base version is invalid, it is discarded and not
# set as the base version.
derived_series = self.factory.makeDistroSeries(
- parent_series=self.factory.makeDistroSeries())
+ previous_series=self.factory.makeDistroSeries())
source_package_name = self.factory.getOrMakeSourcePackageName('foo')
# Create changelogs for both.
changelog_lfa = self.factory.makeChangelog(
@@ -601,7 +601,7 @@
base_pub = ds_diff.base_source_pub
self.assertEqual('1.0', base_pub.source_package_version)
self.assertEqual(
- ds_diff.derived_series.parent_series, base_pub.distroseries)
+ ds_diff.derived_series.previous_series, base_pub.distroseries)
def test_base_source_pub_not_published(self):
# If the base version isn't published, the base version is
@@ -744,7 +744,7 @@
# source_package_release returns the package release of version
# source_version with status PUBLISHED or PENDING.
derived_series = self.factory.makeDistroSeries(
- parent_series=self.factory.makeDistroSeries())
+ previous_series=self.factory.makeDistroSeries())
source_package_name = self.factory.getOrMakeSourcePackageName('foo')
versions = {'derived': u'1.2', 'parent': u'1.3'}
@@ -760,7 +760,7 @@
sourcepackagename=source_package_name,
status=PackagePublishingStatus.PENDING)
self.factory.makeSourcePackagePublishingHistory(
- distroseries=derived_series.parent_series,
+ distroseries=derived_series.previous_series,
version='1.5',
sourcepackagename=source_package_name,
status=PackagePublishingStatus.PENDING)
@@ -790,11 +790,11 @@
# When a relevant packagediff already exists, it is linked to the
# DSD when it is created.
derived_series = self.factory.makeDistroSeries(
- parent_series=self.factory.makeDistroSeries())
+ previous_series=self.factory.makeDistroSeries())
spn = self.factory.getOrMakeSourcePackageName(
name=self.factory.getUniqueString())
parent_spph = self.createPublication(
- spn, ['1.2-1', '1.0-1'], derived_series.parent_series)
+ spn, ['1.2-1', '1.0-1'], derived_series.previous_series)
spph = self.createPublication(
spn, ['1.1-1', '1.0-1'], derived_series)
base_spph = self.createPublication(
@@ -812,7 +812,7 @@
def _initDiffWithMultiplePendingPublications(self, versions, parent):
ds_diff = self.factory.makeDistroSeriesDifference(versions=versions)
if parent:
- series = ds_diff.derived_series.parent_series
+ series = ds_diff.derived_series.previous_series
version = versions.get('parent')
else:
series = ds_diff.derived_series
@@ -901,7 +901,7 @@
def makeDerivedSeries(self):
# Keep tests DRY.
return self.factory.makeDistroSeries(
- parent_series=self.factory.makeDistroSeries())
+ previous_series=self.factory.makeDistroSeries())
def test_getForDistroSeries_default(self):
# By default all differences needing attention for the given
@@ -994,7 +994,7 @@
def test_most_recent_comments(self):
derived_series = self.factory.makeDistroSeries(
- parent_series=self.factory.makeDistroSeries())
+ previous_series=self.factory.makeDistroSeries())
dsds = set(
self.factory.makeDistroSeriesDifference(
derived_series=derived_series) for index in xrange(5))
@@ -1029,7 +1029,7 @@
def test_simple(self):
derived_series = self.factory.makeDistroSeries(
- parent_series=self.factory.makeDistroSeries())
+ previous_series=self.factory.makeDistroSeries())
dsds = [
self.create_difference(derived_series),
self.create_difference(derived_series),
@@ -1059,7 +1059,7 @@
def test_statuses(self):
derived_series = self.factory.makeDistroSeries(
- parent_series=self.factory.makeDistroSeries())
+ previous_series=self.factory.makeDistroSeries())
dsd = self.create_difference(derived_series)
# Change the derived source publication to DELETED.
removeSecurityProxy(dsd.source_pub).status = (
@@ -1081,7 +1081,7 @@
# the release) must exactly match those recorded on the
# DistroSeriesDifference.
derived_series = self.factory.makeDistroSeries(
- parent_series=self.factory.makeDistroSeries())
+ previous_series=self.factory.makeDistroSeries())
dsd = self.create_difference(derived_series)
# Modify the release version.
removeSecurityProxy(
=== modified file 'lib/lp/registry/vocabularies.py'
--- lib/lp/registry/vocabularies.py 2011-03-14 14:54:54 +0000
+++ lib/lp/registry/vocabularies.py 2011-05-17 14:41:19 +0000
@@ -1532,7 +1532,7 @@
parent.distributionID, And(
parent.distributionID != self.distribution.id,
child.distributionID == self.distribution.id,
- child.parent_seriesID == parent.id))
+ child.previous_seriesID == parent.id))
terms = self.find_terms(
DistroSeries.distributionID.is_in(parent_distributions))
if len(terms) == 0:
=== modified file 'lib/lp/soyuz/browser/tests/test_package_copying_mixin.py'
--- lib/lp/soyuz/browser/tests/test_package_copying_mixin.py 2011-05-11 11:09:43 +0000
+++ lib/lp/soyuz/browser/tests/test_package_copying_mixin.py 2011-05-17 14:41:19 +0000
@@ -208,10 +208,11 @@
return self.factory.makeDistribution(
owner=self.person, registrant=self.person)
- def makeDistroSeries(self, parent_series=None):
+ def makeDistroSeries(self, previous_series=None):
"""Create a `DistroSeries`, but quickly by reusing a single Person."""
return self.factory.makeDistroSeries(
- distribution=self.makeDistribution(), parent_series=parent_series,
+ distribution=self.makeDistribution(),
+ previous_series=previous_series,
registrant=self.person)
def makeSPPH(self):
@@ -223,7 +224,7 @@
def makeDerivedSeries(self):
"""Create a derived `DistroSeries`, quickly."""
- series = self.makeDistroSeries(parent_series=self.makeDistroSeries())
+ series = self.makeDistroSeries(previous_series=self.makeDistroSeries())
getUtility(ISourcePackageFormatSelectionSet).add(
series, SourcePackageFormat.FORMAT_1_0)
return series
=== modified file 'lib/lp/soyuz/doc/publishing.txt'
--- lib/lp/soyuz/doc/publishing.txt 2011-05-05 15:11:22 +0000
+++ lib/lp/soyuz/doc/publishing.txt 2011-05-17 14:41:19 +0000
@@ -784,8 +784,8 @@
This simulates a rebuild in of the same source in a more recent
distroseries, like rebuilding SRUs for constant sources.
- >>> breezy_autotest.parent_series = None
- >>> hoary_test.parent_series = breezy_autotest
+ >>> breezy_autotest.previous_series = None
+ >>> hoary_test.previous_series = breezy_autotest
>>> ppa_source.createMissingBuilds()
[]
@@ -796,8 +796,8 @@
Now, let's check the opposite, as if the copy was from a more recent
distroseries to a older one, like a backport rebuild.
- >>> breezy_autotest.parent_series = hoary_test
- >>> hoary_test.parent_series = None
+ >>> breezy_autotest.previous_series = hoary_test
+ >>> hoary_test.previous_series = None
>>> ppa_source.createMissingBuilds()
[]
=== modified file 'lib/lp/soyuz/doc/sourcepackagerelease-build-lookup.txt'
--- lib/lp/soyuz/doc/sourcepackagerelease-build-lookup.txt 2011-03-03 00:43:44 +0000
+++ lib/lp/soyuz/doc/sourcepackagerelease-build-lookup.txt 2011-05-17 14:41:19 +0000
@@ -81,7 +81,7 @@
>>> breezy_autotest = ubuntu.getSeries('breezy-autotest')
>>> breezy_autotest_i386 = breezy_autotest['i386']
- >>> print breezy_autotest.parent_series.title
+ >>> print breezy_autotest.previous_series.title
The Hoary Hedgehog Release
>>> hoary_evo_release = hoary_evo_source['1.0']
=== modified file 'lib/lp/soyuz/model/distroseriesdifferencejob.py'
--- lib/lp/soyuz/model/distroseriesdifferencejob.py 2011-04-13 15:20:12 +0000
+++ lib/lp/soyuz/model/distroseriesdifferencejob.py 2011-05-17 14:41:19 +0000
@@ -92,10 +92,10 @@
"""
if distroseries is None:
return False
- parent_series = distroseries.parent_series
- if parent_series is None:
+ previous_series = distroseries.previous_series
+ if previous_series is None:
return False
- if parent_series.distribution == distroseries.distribution:
+ if previous_series.distribution == distroseries.distribution:
# Differences within a distribution are not tracked.
return False
return find_waiting_jobs(distroseries, sourcepackagename).is_empty()
@@ -148,18 +148,18 @@
in a packageset that the derived series also has.
"""
derived_series = self.distroseries
- parent_series = derived_series.parent_series
+ previous_series = derived_series.previous_series
if has_package(derived_series, self.sourcepackagename):
return True
- if not has_package(parent_series, self.sourcepackagename):
+ if not has_package(previous_series, self.sourcepackagename):
return True
packagesetset = getUtility(IPackagesetSet)
- if packagesetset.getBySeries(parent_series).is_empty():
+ if packagesetset.getBySeries(previous_series).is_empty():
# Parent series does not have packagesets, as would be the
# case for e.g. Debian. In that case, don't filter.
return True
parent_sets = packagesetset.setsIncludingSource(
- self.sourcepackagename, distroseries=parent_series)
+ self.sourcepackagename, distroseries=previous_series)
for parent_set in parent_sets:
for related_set in parent_set.relatedSets():
if related_set.distroseries == derived_series:
=== modified file 'lib/lp/soyuz/scripts/initialise_distroseries.py'
--- lib/lp/soyuz/scripts/initialise_distroseries.py 2011-05-05 17:59:36 +0000
+++ lib/lp/soyuz/scripts/initialise_distroseries.py 2011-05-17 14:41:19 +0000
@@ -75,11 +75,11 @@
self._store = IMasterStore(DistroSeries)
def check(self):
- if self.distroseries.parent_series is not None:
+ if self.distroseries.previous_series is not None:
raise InitialisationError(
("DistroSeries {child.name} has been initialized; it already "
- "derives from {child.parent_series.distribution.name}/"
- "{child.parent_series.name}.").format(
+ "derives from {child.previous_series.distribution.name}/"
+ "{child.previous_series.name}.").format(
child=self.distroseries))
if self.distroseries.distribution.id == self.parent.distribution.id:
self._checkBuilds()
@@ -140,7 +140,7 @@
transaction.commit()
def _set_parent(self):
- self.distroseries.parent_series = self.parent
+ self.distroseries.previous_series = self.parent
def _copy_configuration(self):
self.distroseries.backports_not_automatic = \
=== modified file 'lib/lp/soyuz/scripts/tests/test_initialise_distroseries.py'
--- lib/lp/soyuz/scripts/tests/test_initialise_distroseries.py 2011-05-05 17:59:36 +0000
+++ lib/lp/soyuz/scripts/tests/test_initialise_distroseries.py 2011-05-17 14:41:19 +0000
@@ -363,7 +363,7 @@
# distribution series where the parent series is specified at the time
# of adding the series. New-style derivation leaves the specification
# of the parent series until later.
- child = self.factory.makeDistroSeries(parent_series=self.parent)
+ child = self.factory.makeDistroSeries(previous_series=self.parent)
transaction.commit()
ifp = os.path.join(
config.root, 'scripts', 'ftpmaster-tools',
=== modified file 'lib/lp/soyuz/tests/test_distroseriesdifferencejob.py'
--- lib/lp/soyuz/tests/test_distroseriesdifferencejob.py 2011-04-18 05:25:38 +0000
+++ lib/lp/soyuz/tests/test_distroseriesdifferencejob.py 2011-05-17 14:41:19 +0000
@@ -53,7 +53,7 @@
def makeDerivedDistroSeries(self):
return self.factory.makeDistroSeries(
- parent_series=self.factory.makeDistroSeries())
+ previous_series=self.factory.makeDistroSeries())
def test_baseline(self):
verifyObject(IDistroSeriesDifferenceJobSource, self.getJobSource())
@@ -92,7 +92,7 @@
package = self.factory.makeSourcePackageName()
parent = self.factory.makeDistroSeries()
child = self.factory.makeDistroSeries(
- distribution=parent.distribution, parent_series=parent)
+ distribution=parent.distribution, previous_series=parent)
self.assertFalse(may_require_job(child, package))
def test_may_require_job_only_considers_waiting_jobs_for_redundancy(self):
@@ -148,22 +148,22 @@
def test_createForPackagedPublication_creates_jobs_for_its_child(self):
derived_series = self.factory.makeDistroSeries(
- parent_series=self.makeDerivedDistroSeries())
+ previous_series=self.makeDerivedDistroSeries())
package = self.factory.makeSourcePackageName()
# Create a job for the derived_series parent, which should create
# two jobs. One for derived_series, and the other for its child.
self.getJobSource().createForPackagePublication(
- derived_series.parent_series, package,
+ derived_series.previous_series, package,
PackagePublishingPocket.RELEASE)
jobs = (list(
- find_waiting_jobs(derived_series.parent_series, package)) +
+ find_waiting_jobs(derived_series.previous_series, package)) +
list(find_waiting_jobs(derived_series, package)))
self.assertEqual(2, len(jobs))
self.assertEqual(package.id, jobs[0].metadata['sourcepackagename'])
self.assertEqual(package.id, jobs[1].metadata['sourcepackagename'])
# Lastly, a job was not created for the grandparent.
jobs = list(
- find_waiting_jobs(derived_series.parent_series.parent_series,
+ find_waiting_jobs(derived_series.previous_series.previous_series,
package))
self.assertEqual(0, len(jobs))
@@ -243,14 +243,14 @@
def test_packageset_filter_passes_inherited_packages(self):
derived_series = self.makeDerivedDistroSeries()
- parent_series = derived_series.parent_series
+ previous_series = derived_series.previous_series
# Parent must have a packageset or the filter will pass anyway.
- self.factory.makePackageset(distroseries=parent_series)
+ self.factory.makePackageset(distroseries=previous_series)
package = self.factory.makeSourcePackageName()
# Package is not in the packageset _but_ both the parent and
# derived series have it.
self.factory.makeSourcePackagePublishingHistory(
- distroseries=parent_series, sourcepackagename=package)
+ distroseries=previous_series, sourcepackagename=package)
self.factory.makeSourcePackagePublishingHistory(
distroseries=derived_series, sourcepackagename=package)
job = create_job(derived_series, package)
@@ -258,9 +258,9 @@
def test_packageset_filter_passes_packages_unique_to_derived_series(self):
derived_series = self.makeDerivedDistroSeries()
- parent_series = derived_series.parent_series
+ previous_series = derived_series.previous_series
# Parent must have a packageset or the filter will pass anyway.
- self.factory.makePackageset(distroseries=parent_series)
+ self.factory.makePackageset(distroseries=previous_series)
package = self.factory.makeSourcePackageName()
# Package exists in the derived series but not in the parent
# series.
@@ -273,10 +273,10 @@
# Debian in particular has no packagesets. If the parent series
# has no packagesets, the packageset filter passes all packages.
derived_series = self.makeDerivedDistroSeries()
- parent_series = derived_series.parent_series
+ previous_series = derived_series.previous_series
package = self.factory.makeSourcePackageName()
self.factory.makeSourcePackagePublishingHistory(
- distroseries=parent_series, sourcepackagename=package)
+ distroseries=previous_series, sourcepackagename=package)
job = create_job(derived_series, package)
self.assertTrue(job.passesPackagesetFilter())
@@ -286,9 +286,9 @@
Creates a packageset in the parent that has an equivalent in
`derived_series`.
"""
- parent_series = derived_series.parent_series
+ previous_series = derived_series.previous_series
parent_packageset = self.factory.makePackageset(
- distroseries=parent_series, packages=packages)
+ distroseries=previous_series, packages=packages)
derived_packageset = self.factory.makePackageset(
distroseries=derived_series, packages=packages,
name=parent_packageset.name, owner=parent_packageset.owner,
@@ -296,7 +296,7 @@
def test_packageset_filter_passes_package_in_inherited_packageset(self):
derived_series = self.makeDerivedDistroSeries()
- parent_series = derived_series.parent_series
+ previous_series = derived_series.previous_series
# Package is in a packageset on the parent that the derived
# series also has.
package = self.factory.makeSourcePackageName()
@@ -304,19 +304,19 @@
# Package is in parent series and in a packageset that the
# derived series inherited.
self.factory.makeSourcePackagePublishingHistory(
- distroseries=parent_series, sourcepackagename=package)
+ distroseries=previous_series, sourcepackagename=package)
job = create_job(derived_series, package)
self.assertTrue(job.passesPackagesetFilter())
def test_packageset_filter_blocks_unwanted_parent_package(self):
derived_series = self.makeDerivedDistroSeries()
- parent_series = derived_series.parent_series
+ previous_series = derived_series.previous_series
self.makeInheritedPackageSet(derived_series)
package = self.factory.makeSourcePackageName()
# Package is in the parent series but not in a packageset shared
# between the derived series and the parent series.
self.factory.makeSourcePackagePublishingHistory(
- distroseries=parent_series, sourcepackagename=package)
+ distroseries=previous_series, sourcepackagename=package)
job = create_job(derived_series, package)
self.assertFalse(job.passesPackagesetFilter())
@@ -335,7 +335,7 @@
def makeDerivedDistroSeries(self):
return self.factory.makeDistroSeries(
- parent_series=self.factory.makeDistroSeries())
+ previous_series=self.factory.makeDistroSeries())
def createPublication(self, source_package_name, versions, distroseries,
archive=None):
@@ -378,7 +378,7 @@
self.createPublication(
source_package_name, ['1.0-1derived1', '1.0-1'], derived_series)
self.createPublication(
- source_package_name, ['1.0-1'], derived_series.parent_series)
+ source_package_name, ['1.0-1'], derived_series.previous_series)
# Creating the SPPHs has created jobs for us, so grab it off the
# queue.
jobs = find_waiting_jobs(derived_series, source_package_name)
@@ -391,7 +391,7 @@
# Now create a 1.0-2 upload to the parent.
self.createPublication(
source_package_name, ['1.0-2', '1.0-1'],
- derived_series.parent_series)
+ derived_series.previous_series)
jobs = find_waiting_jobs(derived_series, source_package_name)
self.runJob(jobs[0])
# And the DSD we have a hold of will have updated.
@@ -407,7 +407,7 @@
self.createPublication(
source_package_name, ['1.0-1'], derived_series)
self.createPublication(
- source_package_name, ['1.0-1'], derived_series.parent_series)
+ source_package_name, ['1.0-1'], derived_series.previous_series)
jobs = find_waiting_jobs(derived_series, source_package_name)
self.runJob(jobs[0])
ds_diff = self.findDSD(derived_series, source_package_name)
@@ -430,7 +430,7 @@
source_package_name, ['1.0-1derived1', '1.0-1'], derived_series)
self.createPublication(
source_package_name, ['1.0-2', '1.0-1'],
- derived_series.parent_series)
+ derived_series.previous_series)
jobs = find_waiting_jobs(derived_series, source_package_name)
self.runJob(jobs[0])
ds_diff = self.findDSD(derived_series, source_package_name)
@@ -463,7 +463,7 @@
source_package_name = self.factory.makeSourcePackageName()
self.createPublication(
source_package_name, ['1.0-1'],
- derived_series.parent_series)
+ derived_series.previous_series)
jobs = find_waiting_jobs(derived_series, source_package_name)
self.runJob(jobs[0])
ds_diff = self.findDSD(derived_series, source_package_name)
@@ -479,7 +479,7 @@
self.createPublication(
source_package_name, ['1.0-1'], derived_series)
spph = self.createPublication(
- source_package_name, ['1.0-1'], derived_series.parent_series)
+ source_package_name, ['1.0-1'], derived_series.previous_series)
jobs = find_waiting_jobs(derived_series, source_package_name)
self.runJob(jobs[0])
ds_diff = self.findDSD(derived_series, source_package_name)
@@ -500,7 +500,7 @@
spph = self.createPublication(
source_package_name, ['1.0-1'], derived_series)
self.createPublication(
- source_package_name, ['1.0-1'], derived_series.parent_series)
+ source_package_name, ['1.0-1'], derived_series.previous_series)
jobs = find_waiting_jobs(derived_series, source_package_name)
self.runJob(jobs[0])
ds_diff = self.findDSD(derived_series, source_package_name)
@@ -542,13 +542,13 @@
source_package_name, ['1.0-1derived1', '1.0-1'], derived_series)
self.createPublication(
source_package_name, ['1.0-2', '1.0-1'],
- derived_series.parent_series)
+ derived_series.previous_series)
spr = self.factory.makeSourcePackageRelease(
sourcepackagename=source_package_name, version='1.0-1')
self.factory.makeSourcePackagePublishingHistory(
sourcepackagerelease=spr,
- archive=derived_series.parent_series.main_archive,
- distroseries=derived_series.parent_series,
+ archive=derived_series.previous_series.main_archive,
+ distroseries=derived_series.previous_series,
status=PackagePublishingStatus.SUPERSEDED)
jobs = find_waiting_jobs(derived_series, source_package_name)
self.runJob(jobs[0])
@@ -558,7 +558,7 @@
self.assertIsNot(None, ds_diff[0].parent_package_diff)
self.createPublication(
source_package_name, ['1.0-3', '1.0-2', '1.0-1'],
- derived_series.parent_series)
+ derived_series.previous_series)
jobs = find_waiting_jobs(derived_series, source_package_name)
self.runJob(jobs[0])
# Since the diff showing the changes from 1.0-1 to 1.0-1derived1 is
@@ -580,7 +580,7 @@
'uploader',
]
derived_series = self.factory.makeDistroSeries(
- parent_series=self.factory.makeDistroSeries())
+ previous_series=self.factory.makeDistroSeries())
packages = dict(
(user, self.factory.makeSourcePackageName())
for user in script_users)
=== modified file 'lib/lp/soyuz/tests/test_initialisedistroseriesjob.py'
--- lib/lp/soyuz/tests/test_initialisedistroseriesjob.py 2011-04-15 15:08:20 +0000
+++ lib/lp/soyuz/tests/test_initialisedistroseriesjob.py 2011-05-17 14:41:19 +0000
@@ -67,11 +67,11 @@
self.job_source.create(parent, distroseries)
self.assertRaises(IntegrityError, flush_database_caches)
- def test_run_with_parent_series_already_set(self):
+ def test_run_with_previous_series_already_set(self):
# InitialisationError is raised if the parent series is already set on
# the child.
parent = self.factory.makeDistroSeries()
- distroseries = self.factory.makeDistroSeries(parent_series=parent)
+ distroseries = self.factory.makeDistroSeries(previous_series=parent)
job = self.job_source.create(parent, distroseries)
expected_message = (
"DistroSeries {child.name} has been initialized; it already "
=== modified file 'lib/lp/testing/factory.py'
--- lib/lp/testing/factory.py 2011-05-12 21:33:10 +0000
+++ lib/lp/testing/factory.py 2011-05-17 14:41:19 +0000
@@ -2319,7 +2319,7 @@
def makeDistroRelease(self, distribution=None, version=None,
status=SeriesStatus.DEVELOPMENT,
- parent_series=None, name=None, displayname=None,
+ previous_series=None, name=None, displayname=None,
registrant=None):
"""Make a new distro release."""
if distribution is None:
@@ -2342,19 +2342,19 @@
displayname=displayname,
title=self.getUniqueString(), summary=self.getUniqueString(),
description=self.getUniqueString(),
- parent_series=parent_series, registrant=registrant)
+ previous_series=previous_series, registrant=registrant)
series.status = status
return ProxyFactory(series)
def makeUbuntuDistroRelease(self, version=None,
status=SeriesStatus.DEVELOPMENT,
- parent_series=None, name=None,
+ previous_series=None, name=None,
displayname=None):
"""Short cut to use the celebrity 'ubuntu' as the distribution."""
ubuntu = getUtility(ILaunchpadCelebrities).ubuntu
return self.makeDistroRelease(
- ubuntu, version, status, parent_series, name, displayname)
+ ubuntu, version, status, previous_series, name, displayname)
# Most people think of distro releases as distro series.
makeDistroSeries = makeDistroRelease
@@ -2370,7 +2370,7 @@
if derived_series is None:
parent_series = self.makeDistroSeries()
derived_series = self.makeDistroSeries(
- parent_series=parent_series)
+ previous_series=parent_series)
if source_package_name_str is None:
source_package_name_str = self.getUniqueString('src-name')
@@ -2385,7 +2385,7 @@
base_version = versions.get('base')
if base_version is not None:
- for series in [derived_series, derived_series.parent_series]:
+ for series in [derived_series, derived_series.previous_series]:
spr = self.makeSourcePackageRelease(
sourcepackagename=source_package_name,
version=base_version)
@@ -2410,7 +2410,7 @@
version=versions.get('parent'),
changelog=changelogs.get('parent'))
self.makeSourcePackagePublishingHistory(
- distroseries=derived_series.parent_series,
+ distroseries=derived_series.previous_series,
sourcepackagerelease=spr,
status=PackagePublishingStatus.PUBLISHED)
=== modified file 'lib/lp/translations/doc/distroseries-translations-copy.txt'
--- lib/lp/translations/doc/distroseries-translations-copy.txt 2011-05-12 07:03:06 +0000
+++ lib/lp/translations/doc/distroseries-translations-copy.txt 2011-05-17 14:41:19 +0000
@@ -9,8 +9,8 @@
>>> login("foo.bar@xxxxxxxxxxxxx")
>>> foobuntu = factory.makeDistribution('foobuntu', 'Foobuntu')
>>> barty = factory.makeDistroRelease(foobuntu, '99.0', name='barty')
- >>> carty = factory.makeDistroRelease(foobuntu, '99.1',
- ... name='carty', parent_series=barty)
+ >>> carty = factory.makeDistroRelease(
+ ... foobuntu, '99.1', name='carty', previous_series=barty)
Functions to create source packages, templates and and translations.
@@ -174,8 +174,8 @@
those translations. For testing purposes this series has translation imports
enabled.
- >>> darty = factory.makeDistroRelease(foobuntu, '99.2',
- ... name='darty', parent_series=barty)
+ >>> darty = factory.makeDistroRelease(
+ ... foobuntu, '99.2', name='darty', previous_series=barty)
>>> darty_id = darty.id
>>> darty.defer_translation_imports = False
=== modified file 'lib/lp/translations/model/distroseries_translations_copy.py'
--- lib/lp/translations/model/distroseries_translations_copy.py 2011-05-12 06:28:05 +0000
+++ lib/lp/translations/model/distroseries_translations_copy.py 2011-05-17 14:41:19 +0000
@@ -1,7 +1,7 @@
# Copyright 2009-2010 Canonical Ltd. This software is licensed under the
# GNU Affero General Public License version 3 (see the file LICENSE).
-"""Functions to copy translations from parent to child distroseries."""
+"""Functions to copy translations from previous to child distroseries."""
__metaclass__ = type
@@ -15,7 +15,8 @@
def copy_active_translations(child, transaction, logger):
- """Furnish untranslated child `DistroSeries` with parent's translations.
+ """Furnish untranslated child `DistroSeries` with previous series's
+ translations.
This method uses `MultiTableCopy` to copy data.
@@ -34,9 +35,10 @@
process of being poured back into its source table. In that case the
sensible thing to do is probably to continue pouring it.
"""
- parent = child.parent_series
- if parent is None:
- # We don't have a parent from where we could copy translations.
+ previous_series = child.previous_series
+ if previous_series is None:
+ # We don't have a previous series from where we could copy
+ # translations.
return
translation_tables = [
@@ -52,18 +54,19 @@
logger.info(
"Populating blank distroseries %s with translations from %s." %
- (child.name, parent.name))
+ (child.name, previous_series.name))
# Because this function only deals with the case where "child" is a new
# distroseries without any existing translations attached, it can afford
# to be much more cavalier with ACID considerations than the function that
- # updates an existing translation based on what's found in the parent.
+ # updates an existing translation based on what's found in the previous
+ # series.
# 1. Extraction phase--for every table involved (called a "source table"
# in MultiTableCopy parlance), we create a "holding table." We fill that
- # with all rows from the source table that we want to copy from the parent
- # series. We make some changes to the copied rows, such as making them
- # belong to ourselves instead of our parent series.
+ # with all rows from the source table that we want to copy from the
+ # previous series. We make some changes to the copied rows, such as
+ # making them belong to ourselves instead of our previous series.
#
# The first phase does not modify any tables that other clients may want
# to use, avoiding locking problems.
@@ -72,9 +75,9 @@
# the matching source table, deleting them from the holding table as we
# go. The holding table is dropped once empty.
#
- # The second phase is "batched," moving only a small number of rows at
- # a time, then performing an intermediate commit. This avoids holding
- # too many locks for too long and disrupting regular database service.
+ # The second phase is "batched," moving only a small number of rows at a
+ # time, then performing an intermediate commit. This avoids holding too
+ # many locks for too long and disrupting regular database service.
# Clean up any remains from a previous run. If we got here, that means
# that any such remains are unsalvagable.
@@ -82,15 +85,15 @@
# Copy relevant POTemplates from existing series into a holding table,
# complete with their original id fields.
- where = 'distroseries = %s AND iscurrent' % quote(parent)
+ where = 'distroseries = %s AND iscurrent' % quote(previous_series)
copier.extract('potemplate', [], where)
# Now that we have the data "in private," where nobody else can see it,
# we're free to play with it. No risk of locking other processes out of
# the database.
# Change series identifiers in the holding table to point to the child
- # (right now they all bear the parent's id) and set creation dates to
- # the current transaction time.
+ # (right now they all bear the previous series's id) and set creation
+ # dates to the current transaction time.
cursor().execute('''
UPDATE %s
SET
=== modified file 'scripts/ftpmaster-tools/initialise-from-parent.py'
--- scripts/ftpmaster-tools/initialise-from-parent.py 2011-03-24 16:04:12 +0000
+++ scripts/ftpmaster-tools/initialise-from-parent.py 2011-05-17 14:41:19 +0000
@@ -85,7 +85,8 @@
# specified on the child, so we must unset it and pass it in. This is
# a temporary hack until confidence in InitialiseDistroSeriesJob is
# good, at which point this script will be obsolete.
- parent, distroseries.parent_series = distroseries.parent_series, None
+ parent, distroseries.previous_series = (
+ distroseries.previous_series, None)
ids = InitialiseDistroSeries(parent, distroseries, arches)
ids.check()
log.debug('initialising from parent, copying publishing records.')
=== modified file 'utilities/soyuz-sampledata-setup.py'
--- utilities/soyuz-sampledata-setup.py 2011-03-31 12:53:27 +0000
+++ utilities/soyuz-sampledata-setup.py 2011-05-17 14:41:19 +0000
@@ -225,7 +225,7 @@
new_series = distribution.newSeries(name=name, title=title,
displayname=displayname, summary='Ubuntu %s is good.' % version,
description='%s is awesome.' % version, version=version,
- parent_series=None, registrant=registrant)
+ previous_series=None, registrant=registrant)
new_series.status = status
notify(ObjectCreatedEvent(new_series))
@@ -306,21 +306,21 @@
utility.add(distroseries, format)
-def populate(distribution, parent_series_name, uploader_name, options, log):
+def populate(distribution, previous_series_name, uploader_name, options, log):
"""Set up sample data on `distribution`."""
- parent_series = distribution.getSeries(parent_series_name)
+ previous_series = distribution.getSeries(previous_series_name)
log.info("Configuring sections...")
- create_sections(parent_series)
- add_architecture(parent_series, 'amd64')
+ create_sections(previous_series)
+ add_architecture(previous_series, 'amd64')
log.info("Configuring components and permissions...")
uploader = get_person_set().getByName(uploader_name)
- create_components(parent_series, uploader)
-
- set_source_package_format(parent_series)
-
- create_sample_series(parent_series, log)
+ create_components(previous_series, uploader)
+
+ set_source_package_format(previous_series)
+
+ create_sample_series(previous_series, log)
def sign_code_of_conduct(person, log):