~bzr-pqm/bzr/bzr.dev

« back to all changes in this revision

Viewing changes to bzrlib/selftest/test_commit.py

  • Committer: Martin Pool
  • Date: 2005-09-16 08:36:45 UTC
  • Revision ID: mbp@sourcefrog.net-20050916083645-a5f910d938e03319
- add check that revision ids cannot be committed twice

Show diffs side-by-side

added added

removed removed

Lines of Context:
20
20
from bzrlib.selftest import TestCaseInTempDir
21
21
from bzrlib.branch import Branch
22
22
from bzrlib.commit import Commit
23
 
from bzrlib.errors import PointlessCommit
 
23
from bzrlib.errors import PointlessCommit, BzrError
24
24
 
25
25
 
26
26
# TODO: Test commit with some added, and added-but-missing files
150
150
 
151
151
 
152
152
    def test_reused_rev_id(self):
153
 
        pass
 
153
        """Test that a revision id cannot be reused in a branch"""
 
154
        b = Branch('.', init=True)
 
155
        b.commit('initial', rev_id='test@rev-1', allow_pointless=True)
 
156
        self.assertRaises(Exception,
 
157
                          b.commit,
 
158
                          message='reused id',
 
159
                          rev_id='test@rev-1',
 
160
                          allow_pointless=True)
 
161
                          
154
162
 
155
163
 
156
164
    def test_commit_move(self):