~bzr-pqm/bzr/bzr.dev

« back to all changes in this revision

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

  • Committer: Martin Pool
  • Date: 2007-04-24 05:02:04 UTC
  • mfrom: (2449 +trunk)
  • mto: This revision was merged to the branch mainline in revision 2450.
  • Revision ID: mbp@sourcefrog.net-20070424050204-bfkc1qiq0axt5f14
Merge trunk & fix NEWS conflict

Show diffs side-by-side

added added

removed removed

Lines of Context:
1216
1216
        self.assertEqual([], # Without want_unversioned we should get nothing
1217
1217
                         self.do_iter_changes(tree1, tree2,
1218
1218
                                              specific_files=[u'\u03b1']))
 
1219
 
 
1220
    def test_unknown_empty_dir(self):
 
1221
        tree1 = self.make_branch_and_tree('tree1')
 
1222
        tree2 = self.make_to_branch_and_tree('tree2')
 
1223
        root_id = tree1.get_root_id()
 
1224
        tree2.set_root_id(root_id)
 
1225
 
 
1226
        # Start with 2 identical trees
 
1227
        self.build_tree(['tree1/a/', 'tree1/b/',
 
1228
                         'tree2/a/', 'tree2/b/'])
 
1229
        self.build_tree_contents([('tree1/b/file', 'contents\n'),
 
1230
                                  ('tree2/b/file', 'contents\n')])
 
1231
        tree1.add(['a', 'b', 'b/file'], ['a-id', 'b-id', 'b-file-id'])
 
1232
        tree2.add(['a', 'b', 'b/file'], ['a-id', 'b-id', 'b-file-id'])
 
1233
 
 
1234
        # Now create some unknowns in tree2
 
1235
        # We should find both a/file and a/dir as unknown, but we shouldn't
 
1236
        # recurse into a/dir to find that a/dir/subfile is also unknown.
 
1237
        self.build_tree(['tree2/a/file', 'tree2/a/dir/', 'tree2/a/dir/subfile'])
 
1238
 
 
1239
        tree1, tree2 = self.mutable_trees_to_locked_test_trees(tree1, tree2)
 
1240
 
 
1241
        expected = sorted([
 
1242
            self.unversioned(tree2, u'a/file'),
 
1243
            self.unversioned(tree2, u'a/dir'),
 
1244
            ])
 
1245
        self.assertEqual(expected,
 
1246
                         self.do_iter_changes(tree1, tree2,
 
1247
                                              require_versioned=False,
 
1248
                                              want_unversioned=True))