462
463
self.assertEqual({'c': 'b', 'b': None},
463
464
find_previous_paths(tree2, tree1, ['b', 'c']))
467
class GetCanonicalPath(TestCaseWithTransport):
469
def test_existing_case(self):
470
# Test that we can find a file from a path with different case
471
tree = self.make_branch_and_tree('tree')
472
self.build_tree(['tree/b'])
476
get_canonical_path(tree, 'b', lambda x: x.lower()))
479
get_canonical_path(tree, 'B', lambda x: x.lower()))
481
def test_nonexistant_preserves_case(self):
482
tree = self.make_branch_and_tree('tree')
485
get_canonical_path(tree, 'b', lambda x: x.lower()))
488
get_canonical_path(tree, 'B', lambda x: x.lower()))
490
def test_in_directory_with_case(self):
491
tree = self.make_branch_and_tree('tree')
492
self.build_tree(['tree/a/', 'tree/a/b'])
493
tree.add(['a', 'a/b'])
496
get_canonical_path(tree, 'a/b', lambda x: x.lower()))
499
get_canonical_path(tree, 'A/B', lambda x: x.lower()))
502
get_canonical_path(tree, 'A/b', lambda x: x.lower()))
505
get_canonical_path(tree, 'A/C', lambda x: x.lower()))