~bzr-pqm/bzr/bzr.dev

« back to all changes in this revision

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

  • Committer: Patch Queue Manager
  • Date: 2011-09-26 15:42:24 UTC
  • mfrom: (6165.2.3 avoid-revision-history)
  • Revision ID: pqm@pqm.ubuntu.com-20110926154224-by4s1qzbroh115wn
(jelmer) Remove several calls to Branch.revision_history(). (Jelmer Vernooij)

Show diffs side-by-side

added added

removed removed

Lines of Context:
42
42
        parent.merge_from_branch(mine.branch)
43
43
        parent.commit('merge my change', rev_id='P2')
44
44
        mine.pull(parent.branch)
45
 
        self.assertEqual(['P1', 'P2'], mine.branch.revision_history())
 
45
        self.assertEqual('P2', mine.branch.last_revision())
46
46
 
47
47
    def test_pull_merged_indirect(self):
48
48
        # it should be possible to do a pull from one branch into another
59
59
        parent.merge_from_branch(other.branch)
60
60
        parent.commit('merge other', rev_id='P2')
61
61
        mine.pull(parent.branch)
62
 
        self.assertEqual(['P1', 'P2'], mine.branch.revision_history())
 
62
        self.assertEqual('P2', mine.branch.last_revision())
63
63
 
64
64
    def test_pull_updates_checkout_and_master(self):
65
65
        """Pulling into a checkout updates the checkout and the master branch"""
71
71
        rev2 = other.commit('other commit')
72
72
        # now pull, which should update both checkout and master.
73
73
        checkout.branch.pull(other.branch)
74
 
        self.assertEqual([rev1, rev2], checkout.branch.revision_history())
75
 
        self.assertEqual([rev1, rev2], master_tree.branch.revision_history())
 
74
        self.assertEqual(rev2, checkout.branch.last_revision())
 
75
        self.assertEqual(rev2, master_tree.branch.last_revision())
76
76
 
77
77
    def test_pull_local_updates_checkout_only(self):
78
78
        """Pulling --local into a checkout updates the checkout and not the
85
85
        rev2 = other.commit('other commit')
86
86
        # now pull local, which should update checkout but not master.
87
87
        checkout.branch.pull(other.branch, local = True)
88
 
        self.assertEqual([rev1, rev2], checkout.branch.revision_history())
89
 
        self.assertEqual([rev1], master_tree.branch.revision_history())
 
88
        self.assertEqual(rev2, checkout.branch.last_revision())
 
89
        self.assertEqual(rev1, master_tree.branch.last_revision())
90
90
 
91
91
    def test_pull_local_raises_LocalRequiresBoundBranch_on_unbound(self):
92
92
        """Pulling --local into a branch that is not bound should fail."""
98
98
        # now pull --local, which should raise LocalRequiresBoundBranch error.
99
99
        self.assertRaises(errors.LocalRequiresBoundBranch,
100
100
                          master_tree.branch.pull, other.branch, local = True)
101
 
        self.assertEqual([rev1], master_tree.branch.revision_history())
 
101
        self.assertEqual(rev1, master_tree.branch.last_revision())
102
102
 
103
103
    def test_pull_returns_result(self):
104
104
        parent = self.make_branch_and_tree('parent')
134
134
        tree_a.branch.pull(tree_b.branch, overwrite=True,
135
135
                           stop_revision='rev2b')
136
136
        self.assertEqual('rev2b', tree_a.branch.last_revision())
137
 
        self.assertEqual(tree_b.branch.revision_history(),
138
 
                         tree_a.branch.revision_history())
 
137
        self.assertEqual(tree_b.branch.last_revision(),
 
138
                         tree_a.branch.last_revision())
139
139
 
140
140
    def test_pull_merges_and_fetches_tags(self):
141
141
        """Tags are updated by br.pull(source), and revisions named in those