~bzr-pqm/bzr/bzr.dev

« back to all changes in this revision

Viewing changes to bzrlib/tests/test_transform.py

  • Committer: Aaron Bentley
  • Date: 2009-07-14 21:07:36 UTC
  • mto: This revision was merged to the branch mainline in revision 4538.
  • Revision ID: aaron@aaronbentley.com-20090714210736-1m81n4nls5fe4pxy
Updates from review.

Show diffs side-by-side

added added

removed removed

Lines of Context:
1894
1894
            _mod_revision.NULL_REVISION)
1895
1895
        tt = TransformPreview(basis)
1896
1896
        self.addCleanup(tt.finalize)
1897
 
        e = self.assertRaises(errors.WrongCommitBasis, tt.commit, branch, '')
 
1897
        e = self.assertRaises(ValueError, tt.commit, branch, '')
1898
1898
        self.assertEqual('TreeTransform not based on branch basis: null:',
1899
1899
                         str(e))
1900
1900
 
1918
1918
        tt = TransformPreview(branch.basis_tree())
1919
1919
        rev = tt.commit(branch, 'my message')
1920
1920
        self.assertEqual([], branch.basis_tree().get_parent_ids())
 
1921
        self.assertNotEqual(_mod_revision.NULL_REVISION,
 
1922
                            branch.last_revision())
1921
1923
 
1922
 
    def test_first_commit(self):
 
1924
    def test_first_commit_with_merge_parents(self):
1923
1925
        branch = self.make_branch('branch')
1924
1926
        branch.lock_write()
1925
1927
        self.addCleanup(branch.unlock)
1926
1928
        tt = TransformPreview(branch.basis_tree())
1927
 
        self.assertRaises(errors.MergeParentsInFirstCommit, tt.commit, branch,
 
1929
        e = self.assertRaises(ValueError, tt.commit, branch,
1928
1930
                          'my message', ['rev1b-id'])
1929
 
        self.assertEqual([], branch.basis_tree().get_parent_ids())
 
1931
        self.assertEqual('Cannot supply merge parents for first commit.',
 
1932
                         str(e))
 
1933
        self.assertEqual(_mod_revision.NULL_REVISION, branch.last_revision())
1930
1934
 
1931
1935
    def test_add_files(self):
1932
1936
        branch, tt = self.get_branch_and_transform()