/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: Canonical.com Patch Queue Manager
  • Date: 2009-11-19 07:19:35 UTC
  • mfrom: (4766.2.4 lp459276)
  • Revision ID: pqm@pqm.ubuntu.com-20091119071935-afqk3kz52tlwssze
(Alexander Sack) Add --commit-time option to 'bzr commit'. (#459276)

Show diffs side-by-side

added added

removed removed

Lines of Context:
608
608
        properties = last_rev.properties
609
609
        self.assertEqual('John Doe\nJane Rey', properties['authors'])
610
610
 
 
611
    def test_commit_time(self):
 
612
        tree = self.make_branch_and_tree('tree')
 
613
        self.build_tree(['tree/hello.txt'])
 
614
        tree.add('hello.txt')
 
615
        out, err = self.run_bzr("commit -m hello "
 
616
            "--commit-time='2009-10-10 08:00:00 +0100' tree/hello.txt")
 
617
        last_rev = tree.branch.repository.get_revision(tree.last_revision())
 
618
        self.assertEqual(
 
619
            'Sat 2009-10-10 08:00:00 +0100',
 
620
            osutils.format_date(last_rev.timestamp, last_rev.timezone))
 
621
        
 
622
    def test_commit_time_bad_time(self):
 
623
        tree = self.make_branch_and_tree('tree')
 
624
        self.build_tree(['tree/hello.txt'])
 
625
        tree.add('hello.txt')
 
626
        out, err = self.run_bzr("commit -m hello "
 
627
            "--commit-time='NOT A TIME' tree/hello.txt", retcode=3)
 
628
        self.assertStartsWith(
 
629
            err, "bzr: ERROR: Could not parse --commit-time:")
 
630
 
611
631
    def test_partial_commit_with_renames_in_tree(self):
612
632
        # this test illustrates bug #140419
613
633
        t = self.make_branch_and_tree('.')