~bzr-pqm/bzr/bzr.dev

« back to all changes in this revision

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

  • Committer: Canonical.com Patch Queue Manager
  • Date: 2006-08-30 04:38:44 UTC
  • mfrom: (1908.6.14 use set_parent_trees.)
  • Revision ID: pqm@pqm.ubuntu.com-20060830043844-d570350402a5ad15
Use the new WorkingTree parent-management apis throughout the codebase.

Show diffs side-by-side

added added

removed removed

Lines of Context:
140
140
    def test_record_initial_ghost(self):
141
141
        """The working tree needs to record ghosts during commit."""
142
142
        wt = self.make_branch_and_tree('.')
143
 
        wt.add_pending_merge('non:existent@rev--ision--0--2')
 
143
        wt.set_parent_ids(['non:existent@rev--ision--0--2'],
 
144
            allow_leftmost_as_ghost=True)
144
145
        rev_id = wt.commit('commit against a ghost first parent.')
145
146
        rev = wt.branch.repository.get_revision(rev_id)
146
147
        self.assertEqual(rev.parent_ids, ['non:existent@rev--ision--0--2'])
150
151
    def test_record_two_ghosts(self):
151
152
        """The working tree should preserve all the parents during commit."""
152
153
        wt = self.make_branch_and_tree('.')
153
 
        wt.add_pending_merge('foo@azkhazan-123123-abcabc')
154
 
        wt.add_pending_merge('wibble@fofof--20050401--1928390812')
 
154
        wt.set_parent_ids([
 
155
                'foo@azkhazan-123123-abcabc',
 
156
                'wibble@fofof--20050401--1928390812',
 
157
            ],
 
158
            allow_leftmost_as_ghost=True)
155
159
        rev_id = wt.commit("commit from ghost base with one merge")
156
160
        # the revision should have been committed with two parents
157
161
        rev = wt.branch.repository.get_revision(rev_id)