~bzr-pqm/bzr/bzr.dev

« back to all changes in this revision

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

  • Committer: Canonical.com Patch Queue Manager
  • Date: 2009-05-06 07:48:11 UTC
  • mfrom: (4335.1.1 integration)
  • Revision ID: pqm@pqm.ubuntu.com-20090506074811-dtxiv8kba5sez934
(igc) pull --local (Gary van der Merwe)

Show diffs side-by-side

added added

removed removed

Lines of Context:
70
70
        self.assertEqual([rev1, rev2], checkout.branch.revision_history())
71
71
        self.assertEqual([rev1, rev2], master_tree.branch.revision_history())
72
72
 
 
73
    def test_pull_local_updates_checkout_only(self):
 
74
        """Pulling --local into a checkout updates the checkout and not the
 
75
        master branch"""
 
76
        master_tree = self.make_branch_and_tree('master')
 
77
        rev1 = master_tree.commit('master')
 
78
        checkout = master_tree.branch.create_checkout('checkout')
 
79
 
 
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())
 
86
 
 
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')
 
91
 
 
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())
 
98
 
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')