/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/intertree_implementations/test_compare.py

  • Committer: Aaron Bentley
  • Date: 2006-11-17 06:59:59 UTC
  • mto: This revision was merged to the branch mainline in revision 2162.
  • Revision ID: aaron.bentley@utoronto.ca-20061117065959-x81f1iu6uxar1iar
Make iter_changes private, so it can be changed freely

Show diffs side-by-side

added added

removed removed

Lines of Context:
248
248
        tree2 = self.make_to_branch_and_tree('2')
249
249
        tree1 = self.get_tree_no_parents_no_content(tree1)
250
250
        tree2 = self.get_to_tree_no_parents_no_content(tree2)
251
 
        self.assertEqual([], list(tree2.iter_changes(tree1)))
 
251
        self.assertEqual([], list(tree2._iter_changes(tree1)))
252
252
 
253
253
    def added(self, tree, file_id):
254
254
        entry = tree.inventory[file_id]
275
275
                          self.added(tree2, 'b-id'), 
276
276
                          self.added(tree2, 'c-id'),
277
277
                          self.deleted(tree1, 'empty-root-id')],
278
 
                         list(tree2.iter_changes(tree1)))
 
278
                         list(tree2._iter_changes(tree1)))
279
279
 
280
280
    def test_empty_to_abc_content_a_only(self):
281
281
        tree1 = self.make_branch_and_tree('1')
283
283
        tree1 = self.get_tree_no_parents_no_content(tree1)
284
284
        tree2 = self.get_to_tree_no_parents_abc_content(tree2)
285
285
        self.assertEqual([self.added(tree2, 'a-id')],
286
 
                         list(tree2.iter_changes(tree1, 
 
286
                         list(tree2._iter_changes(tree1, 
287
287
                                                 specific_file_ids=['a-id'])))
288
288
        self.assertEqual([self.deleted(tree2, 'a-id')],
289
 
                         list(tree1.iter_changes(tree2, 
 
289
                         list(tree1._iter_changes(tree2, 
290
290
                                                 specific_file_ids=['a-id'])))
291
291
 
292
292
    def test_empty_to_abc_content_a_and_c_only(self):
296
296
        tree2 = self.get_to_tree_no_parents_abc_content(tree2)
297
297
        self.assertEqual([self.added(tree2, 'a-id'),
298
298
                          self.added(tree2, 'c-id')],
299
 
                         list(tree2.iter_changes(tree1, 
 
299
                         list(tree2._iter_changes(tree1, 
300
300
                                                 specific_file_ids=['a-id', 
301
301
                                                                    'c-id'])))
302
302
        d = self.intertree_class(tree1, tree2).compare(
317
317
        self.assertEqual([self.added(tree1, 'empty-root-id'), 
318
318
                          deleted('root-id'), deleted('a-id'), 
319
319
                          deleted('b-id'), deleted('c-id')],
320
 
                          list(tree1.iter_changes(tree2)))
 
320
                          list(tree1._iter_changes(tree2)))
321
321
 
322
322
    def test_content_modification(self):
323
323
        tree1 = self.make_branch_and_tree('1')
328
328
        self.assertEqual([('a-id', 'a', True, (True, True), 
329
329
                          (root_id, root_id), ('a', 'a'), 
330
330
                          ('file', 'file'), (False, False))], 
331
 
                         list(tree2.iter_changes(tree1)))
 
331
                         list(tree2._iter_changes(tree1)))
332
332
 
333
333
    def test_meta_modification(self):
334
334
        tree1 = self.make_branch_and_tree('1')
337
337
        tree2 = self.get_to_tree_no_parents_abc_content_3(tree2)
338
338
        self.assertEqual([('c-id', 'b/c', False, (True, True), 
339
339
                          ('b-id', 'b-id'), ('c', 'c'), ('file', 'file'), 
340
 
                          (False, True))], list(tree2.iter_changes(tree1)))
 
340
                          (False, True))], list(tree2._iter_changes(tree1)))
341
341
 
342
342
    def test_file_rename(self):
343
343
        tree1 = self.make_branch_and_tree('1')
347
347
        root_id = tree1.inventory.root.file_id
348
348
        self.assertEqual([('a-id', 'd', False, (True, True), 
349
349
                          (root_id, root_id), ('a', 'd'), ('file', 'file'),
350
 
                          (False, False))], list(tree2.iter_changes(tree1)))
 
350
                          (False, False))], list(tree2._iter_changes(tree1)))
351
351
 
352
352
    def test_file_rename_and_modification(self):
353
353
        tree1 = self.make_branch_and_tree('1')
357
357
        root_id = tree1.inventory.root.file_id
358
358
        self.assertEqual([('a-id', 'd', True, (True, True), 
359
359
                          (root_id, root_id), ('a', 'd'), ('file', 'file'),
360
 
                           (False, False))], list(tree2.iter_changes(tree1)))
 
360
                           (False, False))], list(tree2._iter_changes(tree1)))
361
361
 
362
362
    def test_file_rename_and_meta_modification(self):
363
363
        tree1 = self.make_branch_and_tree('1')
367
367
        root_id = tree1.inventory.root.file_id
368
368
        self.assertEqual([('c-id', 'e', False, (True, True), 
369
369
                          ('b-id', root_id), ('c', 'e'), ('file', 'file'), 
370
 
                          (False, True))], list(tree2.iter_changes(tree1)))
 
370
                          (False, True))], list(tree2._iter_changes(tree1)))
371
371
 
372
372
    def test_unchanged_with_renames_and_modifications(self):
373
373
        """want_unchanged should generate a list of unchanged entries."""
389
389
                          ('a-id', 'd', True, (True, True), 
390
390
                          (root_id, root_id), ('a', 'd'), ('file', 'file'),
391
391
                          (False, False)), unchanged('c-id')],
392
 
                         list(tree2.iter_changes(tree1, 
 
392
                         list(tree2._iter_changes(tree1, 
393
393
                                                 include_unchanged=True)))