~bzr-pqm/bzr/bzr.dev

« back to all changes in this revision

Viewing changes to bzrlib/tests/branch_implementations/test_pull.py

  • Committer: Martin Pool
  • Date: 2007-03-01 07:15:55 UTC
  • mfrom: (2308 +trunk)
  • mto: This revision was merged to the branch mainline in revision 2309.
  • Revision ID: mbp@sourcefrog.net-20070301071555-lalebdbi2pltrdnj
merge trunk

Show diffs side-by-side

added added

removed removed

Lines of Context:
80
80
        self.assertRaises(errors.BoundBranchConnectionFailure,
81
81
                checkout.branch.pull, other.branch)
82
82
 
 
83
    def test_pull_overwrite(self):
 
84
        tree_a = self.make_branch_and_tree('tree_a')
 
85
        tree_a.commit('message 1')
 
86
        tree_b = tree_a.bzrdir.sprout('tree_b').open_workingtree()
 
87
        tree_a.commit('message 2', rev_id='rev2a')
 
88
        tree_b.commit('message 2', rev_id='rev2b')
 
89
        self.assertRaises(errors.DivergedBranches, tree_a.pull, tree_b.branch)
 
90
        tree_a.branch.pull(tree_a.branch, overwrite=True,
 
91
                           stop_revision='rev2b')
 
92
        self.assertEqual('rev2b', tree_a.branch.last_revision())
 
93
        self.assertEqual(tree_b.branch.revision_history(),
 
94
                         tree_a.branch.revision_history())
 
95
 
83
96
 
84
97
class TestPullHook(TestCaseWithBranch):
85
98