~bzr-pqm/bzr/bzr.dev

« back to all changes in this revision

Viewing changes to bzrlib/tests/tree_implementations/__init__.py

  • Committer: Robert Collins
  • Date: 2006-07-24 11:26:40 UTC
  • mto: (1852.9.1 Tree.compare().)
  • mto: This revision was merged to the branch mainline in revision 1892.
  • Revision ID: robertc@robertcollins.net-20060724112640-be0b51262ce4a2b6
Implement an InterTreeTestProvider and a trivial test_compare test case.

Show diffs side-by-side

added added

removed removed

Lines of Context:
63
63
 
64
64
class TestCaseWithTree(TestCaseWithBzrDir):
65
65
 
66
 
    def make_branch_and_tree(self, relpath, format=None):
67
 
        made_control = self.make_bzrdir(relpath, format=format)
 
66
    def make_branch_and_tree(self, relpath):
 
67
        made_control = self.make_bzrdir(relpath, format=
 
68
            self.workingtree_format._matchingbzrdir)
68
69
        made_control.create_repository()
69
70
        made_control.create_branch()
70
71
        return self.workingtree_format.initialize(made_control)
71
72
 
72
 
    def get_tree_no_parents_no_content(self):
73
 
        # make a working tree with the right shape
74
 
        tree = self.make_branch_and_tree('.')
 
73
    def get_tree_no_parents_no_content(self, empty_tree, converter=None):
 
74
        """Make a tree with no parents and no contents from empty_tree.
 
75
        
 
76
        :param empty_tree: A working tree with no content and no parents to
 
77
            modify.
 
78
        """
75
79
        # convert that to the final shape
76
 
        return self.workingtree_to_test_tree(tree)
 
80
        if converter is None:
 
81
            converter = self.workingtree_to_test_tree
 
82
        return converter(empty_tree)
77
83
 
78
84
 
79
85
class TreeTestProviderAdapter(WorkingTreeTestProviderAdapter):