Merge lp:~jelmer/bzr-builddeb/build-unreleased into lp:bzr-builddeb

Proposed by Jelmer Vernooij
Status: Merged
Approved by: Jelmer Vernooij
Approved revision: 527
Merged at revision: 527
Proposed branch: lp:~jelmer/bzr-builddeb/build-unreleased
Merge into: lp:bzr-builddeb
Diff against target: 47 lines (+8/-4)
2 files modified
tests/test_util.py (+6/-1)
util.py (+2/-3)
To merge this branch: bzr merge lp:~jelmer/bzr-builddeb/build-unreleased
Reviewer Review Type Date Requested Status
James Westby Approve
Review via email: mp+51419@code.launchpad.net

Description of the change

When building with distribution set to UNRELEASED, assume the build is targetted at the same distribution as the build before.

To post a comment you must log in.
Revision history for this message
James Westby (james-w) :
review: Approve

Preview Diff

[H/L] Next/Prev Comment, [J/K] Next/Prev File, [N/P] Next/Prev Hunk
=== modified file 'tests/test_util.py'
--- tests/test_util.py 2011-02-04 11:30:52 +0000
+++ tests/test_util.py 2011-02-26 16:37:04 +0000
@@ -740,7 +740,7 @@
740740
741 def test_find_previous_upload_unknown(self):741 def test_find_previous_upload_unknown(self):
742 cl = self.make_changelog([("0.1-1", "lucid"),742 cl = self.make_changelog([("0.1-1", "lucid"),
743 ("0.1-2", "UNRELEASED")])743 ("0.1-2", "dunno")])
744 self.assertRaises(UnknownDistribution, _find_previous_upload, cl)744 self.assertRaises(UnknownDistribution, _find_previous_upload, cl)
745745
746 def test_find_previous_upload_missing(self):746 def test_find_previous_upload_missing(self):
@@ -750,6 +750,11 @@
750 cl = self.make_changelog([("0.1-1", "unstable")])750 cl = self.make_changelog([("0.1-1", "unstable")])
751 self.assertRaises(NoPreviousUpload, _find_previous_upload, cl)751 self.assertRaises(NoPreviousUpload, _find_previous_upload, cl)
752752
753 def test_find_previous_upload_unreleased(self):
754 cl = self.make_changelog([("0.1-1", "unstable"),
755 ("0.1-2", "UNRELEASED")])
756 self.assertEqual(Version("0.1-1"), _find_previous_upload(cl))
757
753758
754class SourceFormatTests(TestCaseWithTransport):759class SourceFormatTests(TestCaseWithTransport):
755760
756761
=== modified file 'util.py'
--- util.py 2011-02-04 11:30:52 +0000
+++ util.py 2011-02-26 16:37:04 +0000
@@ -596,8 +596,7 @@
596 :return: Version object for the previous upload596 :return: Version object for the previous upload
597 :raise NoPreviousUpload: Raised when there is no previous upload597 :raise NoPreviousUpload: Raised when there is no previous upload
598 """598 """
599 blocks = cl._blocks599 current_target = find_last_distribution(cl)
600 current_target = blocks[0].distributions.split(" ")[0]
601 all_debian = [r + t for r in DEBIAN_RELEASES for t in DEBIAN_POCKETS]600 all_debian = [r + t for r in DEBIAN_RELEASES for t in DEBIAN_POCKETS]
602 all_ubuntu = [r + t for r in UBUNTU_RELEASES for t in UBUNTU_POCKETS]601 all_ubuntu = [r + t for r in UBUNTU_RELEASES for t in UBUNTU_POCKETS]
603 if current_target in all_debian:602 if current_target in all_debian:
@@ -610,7 +609,7 @@
610 else:609 else:
611 raise UnknownDistribution(current_target)610 raise UnknownDistribution(current_target)
612 previous_version = None611 previous_version = None
613 for block in blocks[1:]:612 for block in cl._blocks[1:]:
614 if block.distributions.split(" ")[0] in match_targets:613 if block.distributions.split(" ")[0] in match_targets:
615 return block.version614 return block.version
616 raise NoPreviousUpload(current_target)615 raise NoPreviousUpload(current_target)

Subscribers

People subscribed via source and target branches