~bzr-pqm/bzr/bzr.dev

« back to all changes in this revision

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

  • Committer: Vincent Ladeuil
  • Date: 2011-06-27 15:42:09 UTC
  • mfrom: (5993 +trunk)
  • mto: (5993.1.1 trunk)
  • mto: This revision was merged to the branch mainline in revision 5994.
  • Revision ID: v.ladeuil+lp@free.fr-20110627154209-azubuhbuxsz109hq
Merge trunk

Show diffs side-by-side

added added

removed removed

Lines of Context:
754
754
            "commit tree/hello.txt", stdin="n\n")
755
755
        self.assertEqual(expected, tree.last_revision())
756
756
 
 
757
    def test_set_commit_message(self):
 
758
        msgeditor.hooks.install_named_hook("set_commit_message",
 
759
                lambda commit_obj, msg: "save me some typing\n", None)
 
760
        tree = self.make_branch_and_tree('tree')
 
761
        self.build_tree(['tree/hello.txt'])
 
762
        tree.add('hello.txt')
 
763
        out, err = self.run_bzr("commit tree/hello.txt")
 
764
        last_rev = tree.branch.repository.get_revision(tree.last_revision())
 
765
        self.assertEqual('save me some typing\n', last_rev.message)
 
766
 
757
767
    def test_commit_without_username(self):
758
768
        """Ensure commit error if username is not set.
759
769
        """
782
792
        self.assertEqual(out, '')
783
793
        self.assertContainsRe(err,
784
794
            'Branch.*test_checkout.*appears to be bound to itself')
785