830
838
self.assertNotContainsRe(log, 'revno: 3.1.1\n')
831
839
self.assertNotContainsRe(log, 'revno: 4\n')
841
def test_log_file_historical_missing(self):
842
# Check logging a deleted file gives an error if the
843
# file isn't found at the end or start of the revision range
844
self.prepare_tree(complex=True)
845
err_msg = "Path unknown at end or start of revision range: file2"
846
err = self.run_bzr('log file2', retcode=3)[1]
847
self.assertContainsRe(err, err_msg)
849
def test_log_file_historical_end(self):
850
# Check logging a deleted file is ok if the file existed
851
# at the end the revision range
852
self.prepare_tree(complex=True)
853
log, err = self.run_bzr('log -r..4 file2')
854
self.assertEquals('', err)
855
self.assertNotContainsRe(log, 'revno: 1\n')
856
self.assertContainsRe(log, 'revno: 2\n')
857
self.assertNotContainsRe(log, 'revno: 3\n')
858
self.assertContainsRe(log, 'revno: 3.1.1\n')
859
self.assertContainsRe(log, 'revno: 4\n')
861
def test_log_file_historical_start(self):
862
# Check logging a deleted file is ok if the file existed
863
# at the start of the revision range
864
self.prepare_tree(complex=True)
865
log, err = self.run_bzr('log file1')
866
self.assertEquals('', err)
867
self.assertContainsRe(log, 'revno: 1\n')
868
self.assertNotContainsRe(log, 'revno: 2\n')
869
self.assertNotContainsRe(log, 'revno: 3\n')
870
self.assertNotContainsRe(log, 'revno: 3.1.1\n')
871
self.assertNotContainsRe(log, 'revno: 4\n')
873
def test_log_file_renamed(self):
874
"""File matched against revision range, not current tree."""
875
self.prepare_tree(complex=True)
877
# Check logging a renamed file gives an error by default
878
err_msg = "Path unknown at end or start of revision range: file3"
879
err = self.run_bzr('log file3', retcode=3)[1]
880
self.assertContainsRe(err, err_msg)
882
# Check we can see a renamed file if we give the right end revision
883
log, err = self.run_bzr('log -r..4 file3')
884
self.assertEquals('', err)
885
self.assertNotContainsRe(log, 'revno: 1\n')
886
self.assertNotContainsRe(log, 'revno: 2\n')
887
self.assertContainsRe(log, 'revno: 3\n')
888
self.assertNotContainsRe(log, 'revno: 3.1.1\n')
889
self.assertNotContainsRe(log, 'revno: 4\n')
833
891
def test_line_log_file(self):
834
892
"""The line log for a file should only list relevant mainline revs"""
835
893
# Note: this also implicitly covers the short logging case.