/brz/remove-bazaar

To get this branch, use:
bzr branch http://gegoxaren.bato24.eu/bzr/brz/remove-bazaar

« back to all changes in this revision

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

  • Committer: James Westby
  • Date: 2009-02-26 19:21:53 UTC
  • mto: This revision was merged to the branch mainline in revision 4077.
  • Revision ID: jw+debian@jameswestby.net-20090226192153-wcqvwsjb5cn37lb9
Allow specifying multiple authors for a revision.

The revision property "author" is now a "\n"-separated list of authors.

--author can be specified multiple times to populate that list at commit
time.

get_apparent_author() is deprecated in favour of get_apparent_authors(),
which will return a list.

Some things (e.g. annotate) still just use the first item from that list,
but there is now support for other code to use all of the authors.

Show diffs side-by-side

added added

removed removed

Lines of Context:
567
567
        properties = last_rev.properties
568
568
        self.assertEqual('John Doe', properties['author'])
569
569
 
 
570
    def test_multiple_authors(self):
 
571
        """Multiple authors can be specyfied, and all are stored."""
 
572
        tree = self.make_branch_and_tree('tree')
 
573
        self.build_tree(['tree/hello.txt'])
 
574
        tree.add('hello.txt')
 
575
        out, err = self.run_bzr("commit -m hello --author='John Doe' "
 
576
                                "--author='Jane Rey' tree/hello.txt")
 
577
        last_rev = tree.branch.repository.get_revision(tree.last_revision())
 
578
        properties = last_rev.properties
 
579
        self.assertEqual('John Doe\nJane Rey', properties['author'])
 
580
 
570
581
    def test_partial_commit_with_renames_in_tree(self):
571
582
        # this test illustrates bug #140419
572
583
        t = self.make_branch_and_tree('.')