/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/blackbox/test_pull.py

  • Committer: Jelmer Vernooij
  • Date: 2011-09-25 16:30:38 UTC
  • mto: This revision was merged to the branch mainline in revision 6216.
  • Revision ID: jelmer@samba.org-20110925163038-5lcgcizzj8hwlue4
Avoid .revision_history().

Show diffs side-by-side

added added

removed removed

Lines of Context:
91
91
        os.chdir('overwriteme')
92
92
        self.run_bzr('pull --overwrite ../a')
93
93
        overwritten = Branch.open('.')
94
 
        self.assertEqual(overwritten.revision_history(),
95
 
                         a.revision_history())
 
94
        self.assertEqual(overwritten.last_revision(),
 
95
                         a.last_revision())
96
96
        a_tree.merge_from_branch(b_tree.branch)
97
97
        a_tree.commit(message="blah4", allow_pointless=True)
98
98
        os.chdir('../b/subdir')
143
143
        self.run_bzr('pull -r 3')
144
144
        self.assertEqual(b.revno(),3)
145
145
        self.run_bzr('pull -r 4')
146
 
        self.assertEqual(a.revision_history(), b.revision_history())
 
146
        self.assertEqual(a.last_revision(), b.last_revision())
147
147
 
148
148
    def test_pull_tags(self):
149
149
        """Tags are updated by pull, and revisions named in those tags are
179
179
        self.build_tree_contents([('a/foo', 'a third change')])
180
180
        a_tree.commit(message='a third change')
181
181
 
182
 
        rev_history_a = a_tree.branch.revision_history()
183
 
        self.assertEqual(len(rev_history_a), 3)
 
182
        self.assertEqual(a_tree.branch.last_revision_info()[0], 3)
184
183
 
185
184
        b_tree.merge_from_branch(a_tree.branch)
186
185
        b_tree.commit(message='merge')
187
186
 
188
 
        self.assertEqual(len(b_tree.branch.revision_history()), 2)
 
187
        self.assertEqual(b_tree.branch.last_revision_info()[0], 2)
189
188
 
190
189
        os.chdir('b')
191
190
        self.run_bzr('pull --overwrite ../a')
192
 
        rev_history_b = b_tree.branch.revision_history()
193
 
        self.assertEqual(len(rev_history_b), 3)
194
 
        self.assertEqual(rev_history_b, rev_history_a)
 
191
        (last_revinfo_b) = b_tree.branch.last_revision_info()
 
192
        self.assertEqual(last_revinfo_b[0], 3)
 
193
        self.assertEqual(last_revinfo_b[1], a_tree.branch.last_revision())
195
194
 
196
195
    def test_overwrite_children(self):
197
196
        # Make sure pull --overwrite sets the revision-history
209
208
        self.build_tree_contents([('a/foo', 'a third change')])
210
209
        a_tree.commit(message='a third change')
211
210
 
212
 
        self.assertEqual(len(a_tree.branch.revision_history()), 3)
 
211
        self.assertEqual(a_tree.branch.last_revision_info()[0], 3)
213
212
 
214
213
        b_tree.merge_from_branch(a_tree.branch)
215
214
        b_tree.commit(message='merge')
216
215
 
217
 
        self.assertEqual(len(b_tree.branch.revision_history()), 2)
 
216
        self.assertEqual(b_tree.branch.last_revision_info()[0], 2)
218
217
 
219
218
        self.build_tree_contents([('a/foo', 'a fourth change\n')])
220
219
        a_tree.commit(message='a fourth change')
221
220
 
222
 
        rev_history_a = a_tree.branch.revision_history()
223
 
        self.assertEqual(len(rev_history_a), 4)
 
221
        rev_info_a = a_tree.branch.last_revision_info()
 
222
        self.assertEqual(rev_history_a[0], 4)
224
223
 
225
224
        # With convergence, we could just pull over the
226
225
        # new change, but with --overwrite, we want to switch our history
227
226
        os.chdir('b')
228
227
        self.run_bzr('pull --overwrite ../a')
229
 
        rev_history_b = b_tree.branch.revision_history()
230
 
        self.assertEqual(len(rev_history_b), 4)
231
 
 
232
 
        self.assertEqual(rev_history_b, rev_history_a)
 
228
        rev_info_b = b_tree.branch.last_revision_info()
 
229
        self.assertEqual(rev_info_b[0], 4)
 
230
        self.assertEqual(rev_info_b, rev_info_a)
233
231
 
234
232
    def test_pull_remember(self):
235
233
        """Pull changes from one branch to another and test parent location."""
304
302
        self.assertEqual(err,
305
303
                ' M  a\nAll changes applied successfully.\n')
306
304
 
307
 
        self.assertEqualDiff(tree_a.branch.revision_history(),
308
 
                             tree_b.branch.revision_history())
 
305
        self.assertEqualDiff(tree_a.branch.last_revision(),
 
306
                             tree_b.branch.last_revision())
309
307
 
310
308
        testament_a = Testament.from_revision(tree_a.branch.repository,
311
309
                                              tree_a.get_parent_ids()[0])