~bzr-pqm/bzr/bzr.dev

« back to all changes in this revision

Viewing changes to bzrlib/tests/intertree_implementations/test_compare.py

  • Committer: John Arbash Meinel
  • Date: 2007-04-30 17:45:10 UTC
  • mfrom: (2472.3.2 renamed_file_111288)
  • mto: This revision was merged to the branch mainline in revision 2475.
  • Revision ID: john@arbash-meinel.com-20070430174510-qdteh5dy45gbj785
[merge] bugfix for bug #111288, resolve conflicts.

Show diffs side-by-side

added added

removed removed

Lines of Context:
1399
1399
        self.assertEqual(expected,
1400
1400
                         self.do_iter_changes(tree1, tree2,
1401
1401
                                              want_unversioned=True))
 
1402
 
 
1403
    def test_renamed_and_unknown(self):
 
1404
        """A file was moved on the filesystem, but not in bzr."""
 
1405
        tree1 = self.make_branch_and_tree('tree1')
 
1406
        tree2 = self.make_to_branch_and_tree('tree2')
 
1407
        root_id = tree1.get_root_id()
 
1408
        tree2.set_root_id(root_id)
 
1409
 
 
1410
        # The final changes are:
 
1411
        # bzr add a b
 
1412
        # mv a a2
 
1413
 
 
1414
        self.build_tree_contents([
 
1415
            ('tree1/a', 'a contents\n'),
 
1416
            ('tree1/b', 'b contents\n'),
 
1417
            ('tree2/a', 'a contents\n'),
 
1418
            ('tree2/b', 'b contents\n'),
 
1419
            ])
 
1420
        tree1.add(['a', 'b'], ['a-id', 'b-id'])
 
1421
        tree2.add(['a', 'b'], ['a-id', 'b-id'])
 
1422
        os.rename('tree2/a', 'tree2/a2')
 
1423
 
 
1424
        tree1, tree2 = self.mutable_trees_to_locked_test_trees(tree1, tree2)
 
1425
 
 
1426
        expected = sorted([
 
1427
            self.missing('a-id', 'a', 'a', tree2.get_root_id(), 'file'),
 
1428
            self.unversioned(tree2, 'a2'),
 
1429
            ])
 
1430
        self.assertEqual(expected,
 
1431
                         self.do_iter_changes(tree1, tree2,
 
1432
                                              want_unversioned=True))