/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

(jelmer) Allow commit builders to update the branch as part of a commit.
 (Jelmer Vernooij)

Show diffs side-by-side

added added

removed removed

Lines of Context:
148
148
        rev = tree.branch.repository.get_revision(rev_id)
149
149
        self.assertEqual('foo bar blah', rev.message)
150
150
 
 
151
    def test_updates_branch(self):
 
152
        tree = self.make_branch_and_tree(".")
 
153
        tree.lock_write()
 
154
        try:
 
155
            builder = tree.branch.get_commit_builder([])
 
156
            list(builder.record_iter_changes(tree, tree.last_revision(),
 
157
                tree.iter_changes(tree.basis_tree())))
 
158
            builder.finish_inventory()
 
159
            will_update_branch = builder.updates_branch
 
160
            rev_id = builder.commit('might update the branch')
 
161
        finally:
 
162
            tree.unlock()
 
163
        actually_updated_branch = (tree.branch.last_revision() == rev_id)
 
164
        self.assertEquals(actually_updated_branch, will_update_branch)
 
165
 
151
166
    def test_commit_with_revision_id_record_entry_contents(self):
152
167
        tree = self.make_branch_and_tree(".")
153
168
        tree.lock_write()