/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: Canonical.com Patch Queue Manager
  • Date: 2010-05-13 18:52:58 UTC
  • mfrom: (5222.1.1 no-rootless-commits)
  • Revision ID: pqm@pqm.ubuntu.com-20100513185258-xtx26u4bsjyhat1n
(abentley) CommitBuilder refuses 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()