/brz/remove-bazaar

To get this branch, use:
bzr branch http://gegoxaren.bato24.eu/bzr/brz/remove-bazaar

« back to all changes in this revision

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

  • Committer: Andrew Bennetts
  • Date: 2008-09-08 12:59:00 UTC
  • mfrom: (3695 +trunk)
  • mto: This revision was merged to the branch mainline in revision 3756.
  • Revision ID: andrew.bennetts@canonical.com-20080908125900-8ywtsr7jqyyatjz0
Merge from bzr.dev.

Show diffs side-by-side

added added

removed removed

Lines of Context:
81
81
        self.assertRaises(errors.BoundBranchConnectionFailure,
82
82
                checkout.branch.pull, other.branch)
83
83
 
 
84
    def test_pull_returns_result(self):
 
85
        parent = self.make_branch_and_tree('parent')
 
86
        parent.commit('1st post', rev_id='P1')
 
87
        mine = parent.bzrdir.sprout('mine').open_workingtree()
 
88
        mine.commit('my change', rev_id='M1')
 
89
        result = parent.branch.pull(mine.branch)
 
90
        self.assertIsNot(None, result)
 
91
        self.assertIs(mine.branch, result.source_branch)
 
92
        self.assertIs(parent.branch, result.target_branch)
 
93
        self.assertIs(parent.branch, result.master_branch)
 
94
        self.assertIs(None, result.local_branch)
 
95
        self.assertEqual(1, result.old_revno)
 
96
        self.assertEqual('P1', result.old_revid)
 
97
        self.assertEqual(2, result.new_revno)
 
98
        self.assertEqual('M1', result.new_revid)
 
99
        self.assertEqual(None, result.tag_conflicts)
 
100
 
84
101
    def test_pull_overwrite(self):
85
102
        tree_a = self.make_branch_and_tree('tree_a')
86
103
        tree_a.commit('message 1')
130
147
    def test_post_pull_empty_history(self):
131
148
        target = self.make_branch('target')
132
149
        source = self.make_branch('source')
133
 
        Branch.hooks.install_hook('post_pull', self.capture_post_pull_hook)
 
150
        Branch.hooks.install_named_hook('post_pull',
 
151
            self.capture_post_pull_hook, None)
134
152
        target.pull(source)
135
153
        # with nothing there we should still get a notification, and
136
154
        # have both branches locked at the notification time.
158
176
            local = BzrDir.create_branch_convenience('local2')
159
177
            local.bind(target)
160
178
        source = self.make_branch('source')
161
 
        Branch.hooks.install_hook('post_pull', self.capture_post_pull_hook)
 
179
        Branch.hooks.install_named_hook('post_pull',
 
180
            self.capture_post_pull_hook, None)
162
181
        local.pull(source)
163
182
        # with nothing there we should still get a notification, and
164
183
        # have both branches locked at the notification time.
177
196
        sourcedir = target.bzrdir.clone(self.get_url('source'))
178
197
        source = MemoryTree.create_on_branch(sourcedir.open_branch())
179
198
        rev2 = source.commit('rev 2')
180
 
        Branch.hooks.install_hook('post_pull', self.capture_post_pull_hook)
 
199
        Branch.hooks.install_named_hook('post_pull',
 
200
            self.capture_post_pull_hook, None)
181
201
        target.branch.pull(source.branch)
182
202
        # with nothing there we should still get a notification, and
183
203
        # have both branches locked at the notification time.