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
=== modified file '__init__.py'
--- __init__.py 2011-10-06 09:51:05 +0000
+++ __init__.py 2011-10-07 11:49:35 +0000
@@ -116,6 +116,12 @@
116 Set the commit message from debian/changelog and set any LP: #1234 to bug116 Set the commit message from debian/changelog and set any LP: #1234 to bug
117 fixed tags."""117 fixed tags."""
118 from bzrlib.plugins.builddeb.util import find_bugs_fixed118 from bzrlib.plugins.builddeb.util import find_bugs_fixed
119 from bzrlib.plugins.builddeb.util import debuild_config
120
121 t = commit.work_tree
122 config = debuild_config(t, False)
123 if config.commit_message_from_changelog == False:
124 return None
119125
120 changes = debian_changelog_commit_message(commit, start_message)126 changes = debian_changelog_commit_message(commit, start_message)
121 if changes is None:127 if changes is None:
122128
=== modified file 'config.py'
--- config.py 2011-02-03 10:24:21 +0000
+++ config.py 2011-10-07 11:49:35 +0000
@@ -290,6 +290,9 @@
290 export_upstream_revision = _opt_property('export-upstream-revision',290 export_upstream_revision = _opt_property('export-upstream-revision',
291 "The revision of the upstream source to use.")291 "The revision of the upstream source to use.")
292292
293 commit_message_from_changelog = _bool_property('commit-message-from-changelog',
294 "Whether the commit message should come from debian/changelog", default=True)
295
293296
294def _test():297def _test():
295 import doctest298 import doctest
296299
=== modified file 'debian/changelog'
--- debian/changelog 2011-10-03 11:34:13 +0000
+++ debian/changelog 2011-10-07 11:49:35 +0000
@@ -4,6 +4,8 @@
4 * Add get-orig-source command which will get the upstream tar file.4 * Add get-orig-source command which will get the upstream tar file.
5 LP: #8621885 LP: #862188
6 * Change "bd-do" command to "builddeb-do" and alias "bd-do".6 * Change "bd-do" command to "builddeb-do" and alias "bd-do".
7 * Add commit-message-from-changelog option for those who do not
8 want commit message set automatically
79
8 -- Jonathan Riddell <jriddell@ubuntu.com> Mon, 03 Oct 2011 12:28:54 +010010 -- Jonathan Riddell <jriddell@ubuntu.com> Mon, 03 Oct 2011 12:28:54 +0100
911
1012
=== modified file 'doc/user_manual/configuration.rst'
--- doc/user_manual/configuration.rst 2011-03-04 18:29:16 +0000
+++ doc/user_manual/configuration.rst 2011-10-07 11:49:35 +0000
@@ -113,6 +113,14 @@
113 upstream code. This has no effect if ``upstream-branch`` is not set.113 upstream code. This has no effect if ``upstream-branch`` is not set.
114114
115115
116Committing
117^^^^^^^^^^
118
119bzr-builddeb will set the commit message from debian/changelog. If you do not
120want this set::
121
122 * ``commit-message-from-changelog = false``
123
116Builders124Builders
117^^^^^^^^125^^^^^^^^
118126
119127
=== modified file 'tests/test_commit_message.py'
--- tests/test_commit_message.py 2011-09-29 17:27:40 +0000
+++ tests/test_commit_message.py 2011-10-07 11:49:35 +0000
@@ -100,6 +100,24 @@
100 self.assertEqual(debian_changelog_commit_message(commit, None),100 self.assertEqual(debian_changelog_commit_message(commit, None),
101 "* two\n* changes\n")101 "* two\n* changes\n")
102102
103 def test_no_set_message_config_option(self):
104 wt = self.make_branch_and_tree(".")
105 self.build_tree(['a', 'debian/', 'debian/changelog', '.bzr-builddeb/', '.bzr-builddeb/default.conf'])
106 f = open(".bzr-builddeb/default.conf", 'wb')
107 try:
108 f.write("[BUILDDEB]\ncommit-message-from-changelog = false")
109 finally:
110 f.close()
111 wt.add(['debian/', 'debian/changelog', '.bzr-builddeb/', '.bzr-builddeb/default.conf'])
112 wt.commit("one")
113 self.set_changelog_content(" * a change\n")
114 wt.add(['a'])
115 wt.lock_read()
116 self.addCleanup(wt.unlock)
117 commit = self._Commit(wt)
118 self.assertEqual(debian_changelog_commit(commit, None),
119 None)
120
103 def test_set_message_with_bugs(self):121 def test_set_message_with_bugs(self):
104 wt = self.make_branch_and_tree(".")122 wt = self.make_branch_and_tree(".")
105 self.build_tree(['a', 'debian/', 'debian/changelog'])123 self.build_tree(['a', 'debian/', 'debian/changelog'])

Subscribers

People subscribed via source and target branches