/brz/remove-bazaar

To get this branch, use:
bzr branch http://gegoxaren.bato24.eu/bzr/brz/remove-bazaar

« back to all changes in this revision

Viewing changes to bzrlib/tests/per_repository/test_commit_builder.py

  • Committer: Aaron Bentley
  • Date: 2010-05-11 13:31:31 UTC
  • mto: This revision was merged to the branch mainline in revision 5229.
  • Revision ID: aaron@aaronbentley.com-20100511133131-e68bir2ul92ag4zs
Refuse to commit trees with no root.

Show diffs side-by-side

added added

removed removed

Lines of Context:
193
193
        self.assertEqual(revision_id,
194
194
            tree.branch.repository.get_inventory(revision_id).revision_id)
195
195
 
 
196
    def test_commit_without_root_errors(self):
 
197
        tree = self.make_branch_and_tree(".")
 
198
        tree.lock_write()
 
199
        try:
 
200
            builder = tree.branch.get_commit_builder([])
 
201
            def do_commit():
 
202
                try:
 
203
                    list(builder.record_iter_changes(
 
204
                        tree, tree.last_revision(), []))
 
205
                    builder.finish_inventory()
 
206
                except:
 
207
                    builder.abort()
 
208
                    raise
 
209
            self.assertRaises(errors.RootMissing, do_commit)
 
210
        finally:
 
211
            tree.unlock()
 
212
 
196
213
    def test_commit_without_root_or_record_iter_changes_errors(self):
197
214
        tree = self.make_branch_and_tree(".")
198
215
        tree.lock_write()