~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:29:39 UTC
  • mto: (2472.2.2 dirstate_fixes)
  • mto: This revision was merged to the branch mainline in revision 2475.
  • Revision ID: john@arbash-meinel.com-20070430172939-hvjgsm1pinoawdy5
Fix bug #111288. When we don't have a match
don't consider the disk file processed. Because we need to
emit an 'unknown' record for it.

Show diffs side-by-side

added added

removed removed

Lines of Context:
1354
1354
        self.assertEqual(expected,
1355
1355
                         self.do_iter_changes(tree1, tree2,
1356
1356
                                              want_unversioned=True))
 
1357
 
 
1358
    def test_renamed_and_unknown(self):
 
1359
        """A file was moved on the filesystem, but not in bzr."""
 
1360
        tree1 = self.make_branch_and_tree('tree1')
 
1361
        tree2 = self.make_to_branch_and_tree('tree2')
 
1362
        root_id = tree1.get_root_id()
 
1363
        tree2.set_root_id(root_id)
 
1364
 
 
1365
        # The final changes are:
 
1366
        # bzr add a b
 
1367
        # mv a a2
 
1368
 
 
1369
        self.build_tree_contents([
 
1370
            ('tree1/a', 'a contents\n'),
 
1371
            ('tree1/b', 'b contents\n'),
 
1372
            ('tree2/a', 'a contents\n'),
 
1373
            ('tree2/b', 'b contents\n'),
 
1374
            ])
 
1375
        tree1.add(['a', 'b'], ['a-id', 'b-id'])
 
1376
        tree2.add(['a', 'b'], ['a-id', 'b-id'])
 
1377
        os.rename('tree2/a', 'tree2/a2')
 
1378
 
 
1379
        tree1, tree2 = self.mutable_trees_to_locked_test_trees(tree1, tree2)
 
1380
 
 
1381
        expected = sorted([
 
1382
            self.missing('a-id', 'a', 'a', tree2.get_root_id(), 'file'),
 
1383
            self.unversioned(tree2, 'a2'),
 
1384
            ])
 
1385
        self.assertEqual(expected,
 
1386
                         self.do_iter_changes(tree1, tree2,
 
1387
                                              want_unversioned=True))