~bzr-pqm/bzr/bzr.dev

« back to all changes in this revision

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

  • Committer: Robey Pointer
  • Date: 2006-09-03 00:28:18 UTC
  • mfrom: (1981 +trunk)
  • mto: This revision was merged to the branch mainline in revision 1996.
  • Revision ID: robey@lag.net-20060903002818-71ca5c7bfea93a26
merge from bzr.dev

Show diffs side-by-side

added added

removed removed

Lines of Context:
136
136
        tree.commit('foo', rev_id='foo', local=True)
137
137
        self.failIf(master.repository.has_revision('foo'))
138
138
        self.assertEqual(None, master.last_revision())
139
 
        
 
139
 
 
140
    def test_record_initial_ghost(self):
 
141
        """The working tree needs to record ghosts during commit."""
 
142
        wt = self.make_branch_and_tree('.')
 
143
        wt.set_parent_ids(['non:existent@rev--ision--0--2'],
 
144
            allow_leftmost_as_ghost=True)
 
145
        rev_id = wt.commit('commit against a ghost first parent.')
 
146
        rev = wt.branch.repository.get_revision(rev_id)
 
147
        self.assertEqual(rev.parent_ids, ['non:existent@rev--ision--0--2'])
 
148
        # parent_sha1s is not populated now, WTF. rbc 20051003
 
149
        self.assertEqual(len(rev.parent_sha1s), 0)
 
150
 
 
151
    def test_record_two_ghosts(self):
 
152
        """The working tree should preserve all the parents during commit."""
 
153
        wt = self.make_branch_and_tree('.')
 
154
        wt.set_parent_ids([
 
155
                'foo@azkhazan-123123-abcabc',
 
156
                'wibble@fofof--20050401--1928390812',
 
157
            ],
 
158
            allow_leftmost_as_ghost=True)
 
159
        rev_id = wt.commit("commit from ghost base with one merge")
 
160
        # the revision should have been committed with two parents
 
161
        rev = wt.branch.repository.get_revision(rev_id)
 
162
        self.assertEqual(['foo@azkhazan-123123-abcabc',
 
163
            'wibble@fofof--20050401--1928390812'],
 
164
            rev.parent_ids)
140
165
 
141
166
class TestCommitProgress(TestCaseWithWorkingTree):
142
167