~bzr-pqm/bzr/bzr.dev

« back to all changes in this revision

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

Merge from bzr.dev.

Show diffs side-by-side

added added

removed removed

Lines of Context:
90
90
 
91
91
    def test_commit_sets_last_revision(self):
92
92
        tree = self.make_branch_and_tree('tree')
93
 
        committed_id = tree.commit('foo', rev_id='foo', allow_pointless=True)
 
93
        committed_id = tree.commit('foo', rev_id='foo')
94
94
        self.assertEqual(['foo'], tree.get_parent_ids())
95
95
        # the commit should have returned the same id we asked for.
96
96
        self.assertEqual('foo', committed_id)
97
97
 
98
98
    def test_commit_returns_revision_id(self):
99
99
        tree = self.make_branch_and_tree('.')
100
 
        committed_id = tree.commit('message', allow_pointless=True)
 
100
        committed_id = tree.commit('message')
101
101
        self.assertTrue(tree.branch.repository.has_revision(committed_id))
102
102
        self.assertNotEqual(None, committed_id)
103
103
 
323
323
            basis.get_reference_revision(basis.path2id('subtree')))
324
324
        self.assertNotEqual(rev_id, rev_id2)
325
325
 
 
326
    def test_nested_pointless_commits_are_pointless(self):
 
327
        tree = self.make_branch_and_tree('.')
 
328
        if not tree.supports_tree_reference():
 
329
            # inapplicable test.
 
330
            return
 
331
        subtree = self.make_branch_and_tree('subtree')
 
332
        tree.add(['subtree'])
 
333
        # record the reference.
 
334
        rev_id = tree.commit('added reference')
 
335
        child_revid = subtree.last_revision()
 
336
        # now do a no-op commit with allow_pointless=False
 
337
        self.assertRaises(errors.PointlessCommit, tree.commit, '',
 
338
            allow_pointless=False)
 
339
        self.assertEqual(child_revid, subtree.last_revision())
 
340
        self.assertEqual(rev_id, tree.last_revision())
 
341
 
326
342
 
327
343
class TestCommitProgress(TestCaseWithWorkingTree):
328
344