1
# Copyright (C) 2009, 2010 Canonical Ltd
1
# Copyright (C) 2009, 2010, 2016 Canonical Ltd
3
3
# This program is free software; you can redistribute it and/or modify
4
4
# it under the terms of the GNU General Public License as published by
34
34
tree = self.create_simple_tree()
35
35
dir = self.make_repository('dir').bzrdir
36
36
result = dir.push_branch(tree.branch)
37
self.assertEquals(tree.branch, result.source_branch)
38
self.assertEquals(dir.open_branch().base, result.target_branch.base)
39
self.assertEquals(dir.open_branch().base,
37
self.assertEqual(tree.branch, result.source_branch)
38
self.assertEqual(dir.open_branch().base, result.target_branch.base)
39
self.assertEqual(dir.open_branch().base,
40
40
tree.branch.get_push_location())
42
42
def test_push_new_empty(self):
43
43
tree = self.make_branch_and_tree('tree')
44
44
dir = self.make_repository('dir').bzrdir
45
45
result = dir.push_branch(tree.branch)
46
self.assertEquals(tree.branch.base, result.source_branch.base)
47
self.assertEquals(dir.open_branch().base,
46
self.assertEqual(tree.branch.base, result.source_branch.base)
47
self.assertEqual(dir.open_branch().base,
48
48
result.target_branch.base)
50
50
def test_push_incremental(self):
56
56
tree.commit('two', rev_id='r2')
57
57
result = dir.push_branch(tree.branch)
58
self.assertEquals(tree.last_revision(),
58
self.assertEqual(tree.last_revision(),
59
59
result.branch_push_result.new_revid)
60
self.assertEquals(2, result.branch_push_result.new_revno)
61
self.assertEquals(tree.branch.base, result.source_branch.base)
62
self.assertEquals(dir.open_branch().base, result.target_branch.base)
60
self.assertEqual(2, result.branch_push_result.new_revno)
61
self.assertEqual(tree.branch.base, result.source_branch.base)
62
self.assertEqual(dir.open_branch().base, result.target_branch.base)