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
1=== modified file 'tests/test_util.py'
2--- tests/test_util.py 2011-02-04 11:30:52 +0000
3+++ tests/test_util.py 2011-02-26 16:37:04 +0000
4@@ -740,7 +740,7 @@
5
6 def test_find_previous_upload_unknown(self):
7 cl = self.make_changelog([("0.1-1", "lucid"),
8- ("0.1-2", "UNRELEASED")])
9+ ("0.1-2", "dunno")])
10 self.assertRaises(UnknownDistribution, _find_previous_upload, cl)
11
12 def test_find_previous_upload_missing(self):
13@@ -750,6 +750,11 @@
14 cl = self.make_changelog([("0.1-1", "unstable")])
15 self.assertRaises(NoPreviousUpload, _find_previous_upload, cl)
16
17+ def test_find_previous_upload_unreleased(self):
18+ cl = self.make_changelog([("0.1-1", "unstable"),
19+ ("0.1-2", "UNRELEASED")])
20+ self.assertEqual(Version("0.1-1"), _find_previous_upload(cl))
21+
22
23 class SourceFormatTests(TestCaseWithTransport):
24
25
26=== modified file 'util.py'
27--- util.py 2011-02-04 11:30:52 +0000
28+++ util.py 2011-02-26 16:37:04 +0000
29@@ -596,8 +596,7 @@
30 :return: Version object for the previous upload
31 :raise NoPreviousUpload: Raised when there is no previous upload
32 """
33- blocks = cl._blocks
34- current_target = blocks[0].distributions.split(" ")[0]
35+ current_target = find_last_distribution(cl)
36 all_debian = [r + t for r in DEBIAN_RELEASES for t in DEBIAN_POCKETS]
37 all_ubuntu = [r + t for r in UBUNTU_RELEASES for t in UBUNTU_POCKETS]
38 if current_target in all_debian:
39@@ -610,7 +609,7 @@
40 else:
41 raise UnknownDistribution(current_target)
42 previous_version = None
43- for block in blocks[1:]:
44+ for block in cl._blocks[1:]:
45 if block.distributions.split(" ")[0] in match_targets:
46 return block.version
47 raise NoPreviousUpload(current_target)

Subscribers

People subscribed via source and target branches