Merge lp:~dobey/tarmac/broken-author into lp:tarmac

Proposed by dobey
Status: Merged
Approved by: dobey
Approved revision: 416
Merged at revision: 417
Proposed branch: lp:~dobey/tarmac/broken-author
Merge into: lp:tarmac
Diff against target: 46 lines (+17/-4)
2 files modified
tarmac/branch.py (+5/-2)
tarmac/tests/test_branch.py (+12/-2)
To merge this branch: bzr merge lp:~dobey/tarmac/broken-author
Reviewer Review Type Date Requested Status
Mike McCracken Approve
Review via email: mp+193827@code.launchpad.net

Commit message

Handle an AssertionError from bzrlib on commit, and add a test for it.

To post a comment you must log in.
Revision history for this message
Mike McCracken (mikemc) :
review: Approve

Preview Diff

[H/L] Next/Prev Comment, [J/K] Next/Prev File, [N/P] Next/Prev Hunk
=== modified file 'tarmac/branch.py'
--- tarmac/branch.py 2013-10-31 18:32:39 +0000
+++ tarmac/branch.py 2013-11-04 17:53:52 +0000
@@ -154,8 +154,11 @@
154 'review identity or vote.')154 'review identity or vote.')
155 revprops['reviews'] = '\n'.join(reviews)155 revprops['reviews'] = '\n'.join(reviews)
156156
157 self.tree.commit(commit_message, committer='Tarmac',157 try:
158 revprops=revprops, authors=authors)158 self.tree.commit(commit_message, committer='Tarmac',
159 revprops=revprops, authors=authors)
160 except AssertionError as error:
161 raise TarmacMergeError(str(error))
159162
160 @property163 @property
161 def landing_candidates(self):164 def landing_candidates(self):
162165
=== modified file 'tarmac/tests/test_branch.py'
--- tarmac/tests/test_branch.py 2013-10-31 22:02:47 +0000
+++ tarmac/tests/test_branch.py 2013-11-04 17:53:52 +0000
@@ -21,8 +21,11 @@
21from bzrlib.errors import PointlessMerge21from bzrlib.errors import PointlessMerge
2222
23from tarmac import branch23from tarmac import branch
24from tarmac.tests import BranchTestCase24from tarmac.exceptions import TarmacMergeError
25from tarmac.tests import MockLPBranch25from tarmac.tests import (
26 BranchTestCase,
27 MockLPBranch,
28)
2629
2730
28class TestBranch(BranchTestCase):31class TestBranch(BranchTestCase):
@@ -199,3 +202,10 @@
199 self.assertEqual(sorted(self.branch1.unmanaged_files), expected)202 self.assertEqual(sorted(self.branch1.unmanaged_files), expected)
200 self.branch1.cleanup()203 self.branch1.cleanup()
201 self.assertEqual(self.branch1.unmanaged_files, [])204 self.assertEqual(self.branch1.unmanaged_files, [])
205
206 def test_commit_with_author_with_newline(self):
207 """Test that committing a branch with an author containing \n fails."""
208 authors = ['author1', 'author2']
209 self.assertRaises(TarmacMergeError,
210 self.branch2.commit,
211 'Authors Merge test', authors=['\n'.join(authors)])

Subscribers

People subscribed via source and target branches