Merge lp:~jr/bzr-builddeb/config-option-commit-message-from-changelog into lp:bzr-builddeb

Proposed by Jonathan Riddell
Status: Merged
Approved by: James Westby
Approved revision: 627
Merged at revision: 625
Proposed branch: lp:~jr/bzr-builddeb/config-option-commit-message-from-changelog
Merge into: lp:bzr-builddeb
Diff against target: 91 lines (+37/-0)
5 files modified
__init__.py (+6/-0)
config.py (+3/-0)
debian/changelog (+2/-0)
doc/user_manual/configuration.rst (+8/-0)
tests/test_commit_message.py (+18/-0)
To merge this branch: bzr merge lp:~jr/bzr-builddeb/config-option-commit-message-from-changelog
Reviewer Review Type Date Requested Status
James Westby Approve
Review via email: mp+78564@code.launchpad.net

Description of the change

  * Add commit-message-from-changelog option for those who do not
    want commit message set automatically

To post a comment you must log in.
626. By Jonathan Riddell

add doc for commit-message-from-changelog

627. By Jonathan Riddell

add test for commit-message-from-changelog option

Revision history for this message
James Westby (james-w) wrote :

Looks great, thanks.

James

review: Approve

Preview Diff

[H/L] Next/Prev Comment, [J/K] Next/Prev File, [N/P] Next/Prev Hunk
1=== modified file '__init__.py'
2--- __init__.py 2011-10-06 09:51:05 +0000
3+++ __init__.py 2011-10-07 11:49:35 +0000
4@@ -116,6 +116,12 @@
5 Set the commit message from debian/changelog and set any LP: #1234 to bug
6 fixed tags."""
7 from bzrlib.plugins.builddeb.util import find_bugs_fixed
8+ from bzrlib.plugins.builddeb.util import debuild_config
9+
10+ t = commit.work_tree
11+ config = debuild_config(t, False)
12+ if config.commit_message_from_changelog == False:
13+ return None
14
15 changes = debian_changelog_commit_message(commit, start_message)
16 if changes is None:
17
18=== modified file 'config.py'
19--- config.py 2011-02-03 10:24:21 +0000
20+++ config.py 2011-10-07 11:49:35 +0000
21@@ -290,6 +290,9 @@
22 export_upstream_revision = _opt_property('export-upstream-revision',
23 "The revision of the upstream source to use.")
24
25+ commit_message_from_changelog = _bool_property('commit-message-from-changelog',
26+ "Whether the commit message should come from debian/changelog", default=True)
27+
28
29 def _test():
30 import doctest
31
32=== modified file 'debian/changelog'
33--- debian/changelog 2011-10-03 11:34:13 +0000
34+++ debian/changelog 2011-10-07 11:49:35 +0000
35@@ -4,6 +4,8 @@
36 * Add get-orig-source command which will get the upstream tar file.
37 LP: #862188
38 * Change "bd-do" command to "builddeb-do" and alias "bd-do".
39+ * Add commit-message-from-changelog option for those who do not
40+ want commit message set automatically
41
42 -- Jonathan Riddell <jriddell@ubuntu.com> Mon, 03 Oct 2011 12:28:54 +0100
43
44
45=== modified file 'doc/user_manual/configuration.rst'
46--- doc/user_manual/configuration.rst 2011-03-04 18:29:16 +0000
47+++ doc/user_manual/configuration.rst 2011-10-07 11:49:35 +0000
48@@ -113,6 +113,14 @@
49 upstream code. This has no effect if ``upstream-branch`` is not set.
50
51
52+Committing
53+^^^^^^^^^^
54+
55+bzr-builddeb will set the commit message from debian/changelog. If you do not
56+want this set::
57+
58+ * ``commit-message-from-changelog = false``
59+
60 Builders
61 ^^^^^^^^
62
63
64=== modified file 'tests/test_commit_message.py'
65--- tests/test_commit_message.py 2011-09-29 17:27:40 +0000
66+++ tests/test_commit_message.py 2011-10-07 11:49:35 +0000
67@@ -100,6 +100,24 @@
68 self.assertEqual(debian_changelog_commit_message(commit, None),
69 "* two\n* changes\n")
70
71+ def test_no_set_message_config_option(self):
72+ wt = self.make_branch_and_tree(".")
73+ self.build_tree(['a', 'debian/', 'debian/changelog', '.bzr-builddeb/', '.bzr-builddeb/default.conf'])
74+ f = open(".bzr-builddeb/default.conf", 'wb')
75+ try:
76+ f.write("[BUILDDEB]\ncommit-message-from-changelog = false")
77+ finally:
78+ f.close()
79+ wt.add(['debian/', 'debian/changelog', '.bzr-builddeb/', '.bzr-builddeb/default.conf'])
80+ wt.commit("one")
81+ self.set_changelog_content(" * a change\n")
82+ wt.add(['a'])
83+ wt.lock_read()
84+ self.addCleanup(wt.unlock)
85+ commit = self._Commit(wt)
86+ self.assertEqual(debian_changelog_commit(commit, None),
87+ None)
88+
89 def test_set_message_with_bugs(self):
90 wt = self.make_branch_and_tree(".")
91 self.build_tree(['a', 'debian/', 'debian/changelog'])

Subscribers

People subscribed via source and target branches