~bzr-pqm/bzr/bzr.dev

« back to all changes in this revision

Viewing changes to bzrlib/tests/workingtree_implementations/test_parents.py

  • Committer: Robert Collins
  • Date: 2006-08-11 05:28:55 UTC
  • mto: (1908.6.4 use set_parent_trees.)
  • mto: This revision was merged to the branch mainline in revision 1972.
  • Revision ID: robertc@robertcollins.net-20060811052855-d3622775878f20db
Add add_parent_tree to WorkingTree.

Show diffs side-by-side

added added

removed removed

Lines of Context:
118
118
            [first_revision, second_revision, third_revision], t)
119
119
 
120
120
 
121
 
class TestAddParentId(TestParents):
 
121
class TestAddParent(TestParents):
122
122
 
123
123
    def test_add_first_parent_id(self):
124
124
        """Test adding the first parent id"""
149
149
        first_revision = tree.commit('first post')
150
150
        tree.add_parent_tree_id('second')
151
151
        self.assertConsistentParents([first_revision, 'second'], tree)
 
152
        
 
153
    def test_add_first_parent_tree(self):
 
154
        """Test adding the first parent id"""
 
155
        tree = self.make_branch_and_tree('.')
 
156
        first_revision = tree.commit('first post')
 
157
        uncommit(tree.branch, tree=tree)
 
158
        tree.add_parent_tree((first_revision,
 
159
            tree.branch.repository.revision_tree(first_revision)))
 
160
        self.assertConsistentParents([first_revision], tree)
 
161
        
 
162
    def test_add_first_parent_tree_ghost(self):
 
163
        """Test adding the first parent id - as a ghost"""
 
164
        tree = self.make_branch_and_tree('.')
 
165
        tree.add_parent_tree(('first-revision', None))
 
166
        self.assertConsistentParents(['first-revision'], tree)
 
167
        
 
168
    def test_add_second_parent_tree(self):
 
169
        """Test adding the second parent id"""
 
170
        tree = self.make_branch_and_tree('.')
 
171
        first_revision = tree.commit('first post')
 
172
        uncommit(tree.branch, tree=tree)
 
173
        second_revision = tree.commit('second post')
 
174
        tree.add_parent_tree((first_revision,
 
175
            tree.branch.repository.revision_tree(first_revision)))
 
176
        self.assertConsistentParents([second_revision, first_revision], tree)
 
177
        
 
178
    def test_add_second_parent_tree_ghost(self):
 
179
        """Test adding the second parent id - as a ghost"""
 
180
        tree = self.make_branch_and_tree('.')
 
181
        first_revision = tree.commit('first post')
 
182
        tree.add_parent_tree(('second', None))
 
183
        self.assertConsistentParents([first_revision, 'second'], tree)