70
70
self.assertEqual([rev1, rev2], checkout.branch.revision_history())
71
71
self.assertEqual([rev1, rev2], master_tree.branch.revision_history())
73
def test_pull_local_updates_checkout_only(self):
74
"""Pulling --local into a checkout updates the checkout and not the
76
master_tree = self.make_branch_and_tree('master')
77
rev1 = master_tree.commit('master')
78
checkout = master_tree.branch.create_checkout('checkout')
80
other = master_tree.branch.bzrdir.sprout('other').open_workingtree()
81
rev2 = other.commit('other commit')
82
# now pull local, which should update checkout but not master.
83
checkout.branch.pull(other.branch, local = True)
84
self.assertEqual([rev1, rev2], checkout.branch.revision_history())
85
self.assertEqual([rev1], master_tree.branch.revision_history())
87
def test_pull_local_raises_LocalRequiresBoundBranch_on_unbound(self):
88
"""Pulling --local into a branch that is not bound should fail."""
89
master_tree = self.make_branch_and_tree('branch')
90
rev1 = master_tree.commit('master')
92
other = master_tree.branch.bzrdir.sprout('other').open_workingtree()
93
rev2 = other.commit('other commit')
94
# now pull --local, which should raise LocalRequiresBoundBranch error.
95
self.assertRaises(errors.LocalRequiresBoundBranch,
96
master_tree.branch.pull, other.branch, local = True)
97
self.assertEqual([rev1], master_tree.branch.revision_history())
73
99
def test_pull_raises_specific_error_on_master_connection_error(self):
74
100
master_tree = self.make_branch_and_tree('master')
75
101
checkout = master_tree.branch.create_checkout('checkout')