/brz/remove-bazaar

To get this branch, use:
bzr branch http://gegoxaren.bato24.eu/bzr/brz/remove-bazaar

« back to all changes in this revision

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

  • Committer: Robert Collins
  • Date: 2006-08-09 11:14:45 UTC
  • mto: (1908.6.2 use set_parent_trees.)
  • mto: This revision was merged to the branch mainline in revision 1972.
  • Revision ID: robertc@robertcollins.net-20060809111445-3a5e9647faf96fc0
Add add_parent_tree_id WorkingTree helper api.

Show diffs side-by-side

added added

removed removed

Lines of Context:
78
78
            (third_revision, rev_tree3)])
79
79
        self.assertConsistentParents(
80
80
            [first_revision, second_revision, third_revision], t)
 
81
 
 
82
 
 
83
class TestAddParentId(TestParents):
 
84
 
 
85
    def test_add_first_parent_id(self):
 
86
        """Test adding the first parent id"""
 
87
        tree = self.make_branch_and_tree('.')
 
88
        first_revision = tree.commit('first post')
 
89
        uncommit(tree.branch, tree=tree)
 
90
        tree.add_parent_tree_id(first_revision)
 
91
        self.assertConsistentParents([first_revision], tree)
 
92
        
 
93
    def test_add_first_parent_id_ghost(self):
 
94
        """Test adding the first parent id - as a ghost"""
 
95
        tree = self.make_branch_and_tree('.')
 
96
        tree.add_parent_tree_id('first-revision')
 
97
        self.assertConsistentParents(['first-revision'], tree)
 
98
        
 
99
    def test_add_second_parent_id(self):
 
100
        """Test adding the second parent id"""
 
101
        tree = self.make_branch_and_tree('.')
 
102
        first_revision = tree.commit('first post')
 
103
        uncommit(tree.branch, tree=tree)
 
104
        second_revision = tree.commit('second post')
 
105
        tree.add_parent_tree_id(first_revision)
 
106
        self.assertConsistentParents([second_revision, first_revision], tree)
 
107
        
 
108
    def test_add_second_parent_id_ghost(self):
 
109
        """Test adding the second parent id - as a ghost"""
 
110
        tree = self.make_branch_and_tree('.')
 
111
        first_revision = tree.commit('first post')
 
112
        tree.add_parent_tree_id('second')
 
113
        self.assertConsistentParents([first_revision, 'second'], tree)