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)
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'))
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'))
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)