~bzr-pqm/bzr/bzr.dev

« back to all changes in this revision

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

  • Committer: Tarmac
  • Author(s): Florent Gallaire
  • Date: 2017-03-17 12:23:47 UTC
  • mfrom: (6621.1.1 fix-gmtime-lite)
  • Revision ID: tarmac-20170317122347-2nnf3cicpgrhux3h
Fix for Windows and 32-bit platforms buggy gmtime(). [r=vila,richard-wilbur]

Show diffs side-by-side

added added

removed removed

Lines of Context:
713
713
        self.assertEqual(
714
714
            'Sat 2009-10-10 08:00:00 +0100',
715
715
            osutils.format_date(last_rev.timestamp, last_rev.timezone))
716
 
        
 
716
 
 
717
    def test_commit_time_negative_windows(self):
 
718
        tree = self.make_branch_and_tree('tree')
 
719
        self.build_tree(['tree/hello.txt'])
 
720
        tree.add('hello.txt')
 
721
        out, err = self.run_bzr("commit -m hello "
 
722
            "--commit-time='1969-10-10 00:00:00 +0000' tree/hello.txt")
 
723
        last_rev = tree.branch.repository.get_revision(tree.last_revision())
 
724
        self.assertEqual(
 
725
            'Fri 1969-10-10 00:00:00 +0000',
 
726
            osutils.format_date(last_rev.timestamp, last_rev.timezone))
 
727
 
 
728
    def test_commit_time_negative_32bit(self):
 
729
        tree = self.make_branch_and_tree('tree')
 
730
        self.build_tree(['tree/hello.txt'])
 
731
        tree.add('hello.txt')
 
732
        out, err = self.run_bzr("commit -m hello "
 
733
            "--commit-time='1900-01-01 00:00:00 +0000' tree/hello.txt")
 
734
        last_rev = tree.branch.repository.get_revision(tree.last_revision())
 
735
        self.assertEqual(
 
736
            'Mon 1900-01-01 00:00:00 +0000',
 
737
            osutils.format_date(last_rev.timestamp, last_rev.timezone))
 
738
 
 
739
    def test_commit_time_positive_32bit(self):
 
740
        tree = self.make_branch_and_tree('tree')
 
741
        self.build_tree(['tree/hello.txt'])
 
742
        tree.add('hello.txt')
 
743
        out, err = self.run_bzr("commit -m hello "
 
744
            "--commit-time='2039-01-01 00:00:00 +0000' tree/hello.txt")
 
745
        last_rev = tree.branch.repository.get_revision(tree.last_revision())
 
746
        self.assertEqual(
 
747
            'Sat 2039-01-01 00:00:00 +0000',
 
748
            osutils.format_date(last_rev.timestamp, last_rev.timezone))
 
749
 
717
750
    def test_commit_time_bad_time(self):
718
751
        tree = self.make_branch_and_tree('tree')
719
752
        self.build_tree(['tree/hello.txt'])