~bzr-pqm/bzr/bzr.dev

« back to all changes in this revision

Viewing changes to bzrlib/tests/test_branch.py

  • Committer: John Arbash Meinel
  • Date: 2008-07-22 19:48:40 UTC
  • mto: (3514.4.6 merge_lca_multi)
  • mto: This revision was merged to the branch mainline in revision 3590.
  • Revision ID: john@arbash-meinel.com-20080722194840-dqp3t6mc12f2s36n
Use the new BranchBuilder api in a Branch test

Show diffs side-by-side

added added

removed removed

Lines of Context:
243
243
        self.assertEqual('ftp://bazaar-vcs.org', branch.get_bound_location())
244
244
 
245
245
    def test_set_revision_history(self):
246
 
        tree = self.make_branch_and_memory_tree('.',
247
 
            format=self.get_format_name())
248
 
        tree.lock_write()
249
 
        try:
250
 
            tree.add('.')
251
 
            tree.commit('foo', rev_id='foo')
252
 
            tree.commit('bar', rev_id='bar')
253
 
            tree.branch.set_revision_history(['foo', 'bar'])
254
 
            tree.branch.set_revision_history(['foo'])
255
 
            self.assertRaises(errors.NotLefthandHistory,
256
 
                              tree.branch.set_revision_history, ['bar'])
257
 
        finally:
258
 
            tree.unlock()
 
246
        builder = self.make_branch_builder('.', format=self.get_format_name())
 
247
        builder.build_snapshot('foo', None,
 
248
            [('add', ('', None, 'directory', None))],
 
249
            message='foo')
 
250
        builder.build_snapshot('bar', None, [], message='bar')
 
251
        branch = builder.get_branch()
 
252
        branch.lock_write()
 
253
        self.addCleanup(branch.unlock)
 
254
        branch.set_revision_history(['foo', 'bar'])
 
255
        branch.set_revision_history(['foo'])
 
256
        self.assertRaises(errors.NotLefthandHistory,
 
257
                          branch.set_revision_history, ['bar'])
259
258
 
260
259
    def do_checkout_test(self, lightweight=False):
261
260
        tree = self.make_branch_and_tree('source',