Merge lp:~jelmer/bzr-builddeb/619295-unversioned-debian-symlink into lp:bzr-builddeb

Proposed by Jelmer Vernooij
Status: Merged
Merged at revision: 512
Proposed branch: lp:~jelmer/bzr-builddeb/619295-unversioned-debian-symlink
Merge into: lp:bzr-builddeb
Diff against target: 50 lines (+15/-2)
3 files modified
debian/changelog (+3/-1)
tests/test_util.py (+9/-0)
util.py (+3/-1)
To merge this branch: bzr merge lp:~jelmer/bzr-builddeb/619295-unversioned-debian-symlink
Reviewer Review Type Date Requested Status
James Westby Approve
Review via email: mp+48448@code.launchpad.net

Description of the change

This fixes bzr-builddeb to cope with unversioned "debian/" symlinks.

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

Oh, should probably have SymlinkFeature protecting the test? Not that running
the tests on Windows would do very well.

Thanks,

James

Preview Diff

[H/L] Next/Prev Comment, [J/K] Next/Prev File, [N/P] Next/Prev Hunk
1=== modified file 'debian/changelog'
2--- debian/changelog 2011-02-03 10:37:01 +0000
3+++ debian/changelog 2011-02-03 11:02:48 +0000
4@@ -45,8 +45,10 @@
5 kind of compression is supported on tarballs. LP: #627718
6 * Support upstream version strings containing dashes. Patch by Stefano
7 Rivera. LP: #711826
8+ * Support unversioned debian/ symlink in working tree when finding
9+ changelog and larstiq mode. LP: #619295
10
11- -- Jelmer Vernooij <jelmer@debian.org> Thu, 03 Feb 2011 11:36:59 +0100
12+ -- Jelmer Vernooij <jelmer@debian.org> Thu, 03 Feb 2011 11:59:26 +0100
13
14 bzr-builddeb (2.5) unstable; urgency=low
15
16
17=== modified file 'tests/test_util.py'
18--- tests/test_util.py 2011-01-28 17:14:25 +0000
19+++ tests/test_util.py 2011-02-03 11:02:48 +0000
20@@ -170,6 +170,15 @@
21 self.assertEqual(str(cl), cl_block1)
22 self.assertEqual(lq, True)
23
24+ def test_find_changelog_lq_unversioned_debian_symlink(self):
25+ # LarstiQ mode, but with an unversioned "debian" -> "." symlink.
26+ # Bug 619295
27+ tree = self.make_branch_and_tree('.')
28+ self.write_changelog('changelog')
29+ tree.add(['changelog'])
30+ os.symlink('.', 'debian')
31+ self.assertRaises(AddChangelogError, find_changelog, tree, True)
32+
33 def test_find_changelog_nomerge_lq(self):
34 tree = self.make_branch_and_tree('.')
35 self.write_changelog('changelog')
36
37=== modified file 'util.py'
38--- util.py 2011-02-02 16:04:04 +0000
39+++ util.py 2011-02-03 11:02:48 +0000
40@@ -158,7 +158,9 @@
41 # If it is a "larstiq" pacakge and debian is a symlink to
42 # "." then it will have found debian/changelog. Try and detect
43 # this.
44- if (t.kind(t.path2id('debian')) == 'symlink' and
45+ debian_file_id = t.path2id('debian')
46+ if (debian_file_id is not None and
47+ t.kind(debian_file_id) == 'symlink' and
48 t.get_symlink_target(t.path2id('debian')) == '.'):
49 changelog_file = 'changelog'
50 larstiq = True

Subscribers

People subscribed via source and target branches