~bzr-pqm/bzr/bzr.dev

« back to all changes in this revision

Viewing changes to bzrlib/tests/test_merge_directive.py

  • Committer: Martin Pool
  • Date: 2007-04-04 01:22:11 UTC
  • mfrom: (2393.1.1 bzr.docs)
  • mto: This revision was merged to the branch mainline in revision 2397.
  • Revision ID: mbp@sourcefrog.net-20070404012211-sq269me6bai9m6xk
merge trunk and doc fix from elliot

Show diffs side-by-side

added added

removed removed

Lines of Context:
295
295
        md.message = 'Commit of rev2a with special message'
296
296
        message = md.to_email('pqm@example.com', tree_a.branch)
297
297
        self.assertContainsRe(message.as_string(), EMAIL2)
 
298
 
 
299
    def test_install_revisions_branch(self):
 
300
        tree_a, tree_b, branch_c = self.make_trees()
 
301
        md = merge_directive.MergeDirective.from_objects(
 
302
            tree_a.branch.repository, 'rev2a', 500, 36, tree_b.branch.base,
 
303
            patch_type=None, public_branch=tree_a.branch.base)
 
304
        self.assertFalse(tree_b.branch.repository.has_revision('rev2a'))
 
305
        revision = md.install_revisions(tree_b.branch.repository)
 
306
        self.assertEqual('rev2a', revision)
 
307
        self.assertTrue(tree_b.branch.repository.has_revision('rev2a'))
 
308
 
 
309
    def test_install_revisions_bundle(self):
 
310
        tree_a, tree_b, branch_c = self.make_trees()
 
311
        md = merge_directive.MergeDirective.from_objects(
 
312
            tree_a.branch.repository, 'rev2a', 500, 36, tree_b.branch.base,
 
313
            patch_type='bundle', public_branch=tree_a.branch.base)
 
314
        self.assertFalse(tree_b.branch.repository.has_revision('rev2a'))
 
315
        revision = md.install_revisions(tree_b.branch.repository)
 
316
        self.assertEqual('rev2a', revision)
 
317
        self.assertTrue(tree_b.branch.repository.has_revision('rev2a'))
 
318
 
 
319
    def test_get_target_revision_nofetch(self):
 
320
        tree_a, tree_b, branch_c = self.make_trees()
 
321
        tree_b.branch.fetch(tree_a.branch)
 
322
        md = merge_directive.MergeDirective.from_objects(
 
323
            tree_a.branch.repository, 'rev2a', 500, 36, tree_b.branch.base,
 
324
            patch_type=None, public_branch=tree_a.branch.base)
 
325
        md.source_branch = '/dev/null'
 
326
        revision = md.install_revisions(tree_b.branch.repository)
 
327
        self.assertEqual('rev2a', revision)