~bzr-pqm/bzr/bzr.dev

« back to all changes in this revision

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

  • Committer: Jelmer Vernooij
  • Date: 2011-10-04 14:08:14 UTC
  • mfrom: (6187 +trunk)
  • mto: This revision was merged to the branch mainline in revision 6189.
  • Revision ID: jelmer@samba.org-20111004140814-cltag93d2l5j9zyf
MergeĀ lp:bzr

Show diffs side-by-side

added added

removed removed

Lines of Context:
16
16
 
17
17
"""Tests for InterBranch.pull behaviour."""
18
18
 
19
 
import os
20
 
 
21
19
from bzrlib.branch import Branch
22
20
from bzrlib.bzrdir import BzrDir
23
21
from bzrlib import errors
42
40
        parent.merge_from_branch(mine.branch)
43
41
        parent.commit('merge my change', rev_id='P2')
44
42
        mine.pull(parent.branch)
45
 
        self.assertEqual(['P1', 'P2'], mine.branch.revision_history())
 
43
        self.assertEqual('P2', mine.branch.last_revision())
46
44
 
47
45
    def test_pull_merged_indirect(self):
48
46
        # it should be possible to do a pull from one branch into another
59
57
        parent.merge_from_branch(other.branch)
60
58
        parent.commit('merge other', rev_id='P2')
61
59
        mine.pull(parent.branch)
62
 
        self.assertEqual(['P1', 'P2'], mine.branch.revision_history())
 
60
        self.assertEqual('P2', mine.branch.last_revision())
63
61
 
64
62
    def test_pull_updates_checkout_and_master(self):
65
63
        """Pulling into a checkout updates the checkout and the master branch"""
70
68
        rev2 = other.commit('other commit')
71
69
        # now pull, which should update both checkout and master.
72
70
        checkout.branch.pull(other.branch)
73
 
        self.assertEqual([rev1, rev2], checkout.branch.revision_history())
74
 
        self.assertEqual([rev1, rev2], master_tree.branch.revision_history())
 
71
        self.assertEqual(rev2, checkout.branch.last_revision())
 
72
        self.assertEqual(rev2, master_tree.branch.last_revision())
75
73
 
76
74
    def test_pull_raises_specific_error_on_master_connection_error(self):
77
75
        master_tree = self.make_from_branch_and_tree('master')
118
116
        tree_a.branch.pull(tree_b.branch, overwrite=True,
119
117
                           stop_revision='rev2b')
120
118
        self.assertEqual('rev2b', tree_a.branch.last_revision())
121
 
        self.assertEqual(tree_b.branch.revision_history(),
122
 
                         tree_a.branch.revision_history())
 
119
        self.assertEqual(tree_b.branch.last_revision(),
 
120
                         tree_a.branch.last_revision())
123
121
 
124
122
 
125
123
class TestPullHook(TestCaseWithInterBranch):