470
470
r"Commit refused\."],
471
471
'commit -m add-b --fixes=orange',
472
472
working_dir='tree')
474
def test_no_author(self):
475
"""If the author is not specified, the author property is not set."""
476
tree = self.make_branch_and_tree('tree')
477
self.build_tree(['tree/hello.txt'])
478
tree.add('hello.txt')
479
self.run_bzr( 'commit -m hello tree/hello.txt')
480
last_rev = tree.branch.repository.get_revision(tree.last_revision())
481
properties = last_rev.properties
482
self.assertFalse('author' in properties)
484
def test_author_sets_property(self):
485
"""commit --author='John Doe <jdoe@example.com>' sets the author
488
tree = self.make_branch_and_tree('tree')
489
self.build_tree(['tree/hello.txt'])
490
tree.add('hello.txt')
491
self.run_bzr("commit -m hello --author='John Doe <jdoe@example.com>' "
493
last_rev = tree.branch.repository.get_revision(tree.last_revision())
494
properties = last_rev.properties
495
self.assertEqual('John Doe <jdoe@example.com>', properties['author'])
497
def test_author_no_email(self):
498
"""Author's name without an email address is allowed, too."""
499
tree = self.make_branch_and_tree('tree')
500
self.build_tree(['tree/hello.txt'])
501
tree.add('hello.txt')
502
out, err = self.run_bzr("commit -m hello --author='John Doe' "
504
last_rev = tree.branch.repository.get_revision(tree.last_revision())
505
properties = last_rev.properties
506
self.assertEqual('John Doe', properties['author'])