~bzr-pqm/bzr/bzr.dev

« back to all changes in this revision

Viewing changes to bzrlib/tests/test_commit.py

  • Committer: Martin Pool
  • Date: 2007-06-15 07:01:24 UTC
  • mfrom: (2528 +trunk)
  • mto: This revision was merged to the branch mainline in revision 2530.
  • Revision ID: mbp@sourcefrog.net-20070615070124-clpwqh5gxc4wbf9l
Merge trunk

Show diffs side-by-side

added added

removed removed

Lines of Context:
681
681
        repository.add_inventory = raise_
682
682
        self.assertRaises(errors.NoSuchFile, tree.commit, message_callback=cb)
683
683
        self.assertFalse(cb.called)
 
684
 
 
685
    def test_selected_file_merge_commit(self):
 
686
        """Ensure the correct error is raised"""
 
687
        tree = self.make_branch_and_tree('foo')
 
688
        # pending merge would turn into a left parent
 
689
        tree.commit('commit 1')
 
690
        tree.add_parent_tree_id('example')
 
691
        self.build_tree(['foo/bar', 'foo/baz'])
 
692
        tree.add(['bar', 'baz'])
 
693
        err = self.assertRaises(errors.CannotCommitSelectedFileMerge,
 
694
            tree.commit, 'commit 2', specific_files=['bar', 'baz'])
 
695
        self.assertEqual(['bar', 'baz'], err.files)
 
696
        self.assertEqual('Selected-file commit of merges is not supported'
 
697
                         ' yet: files bar, baz', str(err))