~bzr-pqm/bzr/bzr.dev

« back to all changes in this revision

Viewing changes to bzrlib/tests/test_commit.py

  • Committer: James Westby
  • Date: 2009-02-27 15:14:34 UTC
  • mto: This revision was merged to the branch mainline in revision 4077.
  • Revision ID: jw+debian@jameswestby.net-20090227151434-kk7lqj62fnqmj2ng
Use a new "authors" revision property to allow multiple authors

The "authors" revision property holds a "\n" separated list of
authors.

"author" is still read, but will be overriden by "authors" if
present.

Show diffs side-by-side

added added

removed removed

Lines of Context:
747
747
        rev_id = tree.commit('commit 1')
748
748
        rev = tree.branch.repository.get_revision(rev_id)
749
749
        self.assertFalse('author' in rev.properties)
 
750
        self.assertFalse('authors' in rev.properties)
750
751
 
751
752
    def test_commit_author(self):
752
753
        """Passing a non-empty author kwarg to MutableTree.commit should add
758
759
                tree.commit, 'commit 1', author='John Doe <jdoe@example.com>')
759
760
        rev = tree.branch.repository.get_revision(rev_id)
760
761
        self.assertEqual('John Doe <jdoe@example.com>',
761
 
                         rev.properties['author'])
 
762
                         rev.properties['authors'])
 
763
        self.assertFalse('author' in rev.properties)
762
764
 
763
765
    def test_commit_empty_authors_list(self):
764
766
        """Passing an empty list to authors shouldn't add the property."""
766
768
        rev_id = tree.commit('commit 1', authors=[])
767
769
        rev = tree.branch.repository.get_revision(rev_id)
768
770
        self.assertFalse('author' in rev.properties)
 
771
        self.assertFalse('authors' in rev.properties)
769
772
 
770
773
    def test_multiple_authors(self):
771
774
        tree = self.make_branch_and_tree('foo')
774
777
                         'Jane Rey <jrey@example.com>'])
775
778
        rev = tree.branch.repository.get_revision(rev_id)
776
779
        self.assertEqual('John Doe <jdoe@example.com>\n'
777
 
                'Jane Rey <jrey@example.com>', rev.properties['author'])
 
780
                'Jane Rey <jrey@example.com>', rev.properties['authors'])
 
781
        self.assertFalse('author' in rev.properties)
778
782
 
779
783
    def test_author_and_authors_incompatible(self):
780
784
        tree = self.make_branch_and_tree('foo')