~bzr-pqm/bzr/bzr.dev

« back to all changes in this revision

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

  • Committer: Andrew Bennetts
  • Date: 2010-10-13 00:26:41 UTC
  • mto: This revision was merged to the branch mainline in revision 5498.
  • Revision ID: andrew.bennetts@canonical.com-20101013002641-9tlh9k89mlj1666m
Keep docs-plain working.

Show diffs side-by-side

added added

removed removed

Lines of Context:
19
19
 
20
20
from itertools import izip
21
21
import os
 
22
import re
22
23
 
23
24
from bzrlib import (
24
25
    branchbuilder,
28
29
    tests,
29
30
    )
30
31
from bzrlib.tests import (
 
32
    script,
31
33
    test_log,
32
 
    features,
33
34
    )
34
35
 
35
36
 
76
77
                self.log_catcher = test_log.LogCatcher(*args, **kwargs)
77
78
                # Always return our own log formatter
78
79
                return self.log_catcher
79
 
        # Break cycle with closure over self on cleanup by removing method
80
 
        self.addCleanup(setattr, MyLogFormatter, "__new__", None)
81
80
 
82
81
        def getme(branch):
83
82
                # Always return our own log formatter class hijacking the
443
442
        self.assertContainsRe(log, r'tags: tag1')
444
443
 
445
444
 
446
 
class TestLogSignatures(TestLog):
447
 
 
448
 
    def test_log_with_signatures(self):
449
 
        self.requireFeature(features.gpgme)
450
 
 
451
 
        tree = self.make_linear_branch(format='dirstate-tags')
452
 
 
453
 
        log = self.run_bzr("log --signatures")[0]
454
 
        self.assertTrue('signature: no signature' in log)
455
 
 
456
 
    def test_log_without_signatures(self):
457
 
        self.requireFeature(features.gpgme)
458
 
 
459
 
        tree = self.make_linear_branch(format='dirstate-tags')
460
 
 
461
 
        log = self.run_bzr("log")[0]
462
 
        self.assertFalse('signature: no signature' in log)
463
 
 
464
 
 
465
445
class TestLogVerbose(TestLog):
466
446
 
467
447
    def setUp(self):
483
463
    def test_log_short_verbose(self):
484
464
        self.assertUseShortDeltaFormat(['log', '--short', '-v'])
485
465
 
486
 
    def test_log_s_verbose(self):
487
 
        self.assertUseShortDeltaFormat(['log', '-S', '-v'])
488
 
 
489
466
    def test_log_short_verbose_verbose(self):
490
467
        self.assertUseLongDeltaFormat(['log', '--short', '-vv'])
491
468
 
947
924
        self.prepare_tree()
948
925
        os.chdir("dir1")
949
926
        self.assertLogRevnos(['dir2', 'file5'], ['5', '3'])
950
 
 
951
 
 
952
 
class MainlineGhostTests(TestLogWithLogCatcher):
953
 
 
954
 
    def setUp(self):
955
 
        super(MainlineGhostTests, self).setUp()
956
 
        tree = self.make_branch_and_tree('')
957
 
        tree.set_parent_ids(["spooky"], allow_leftmost_as_ghost=True)
958
 
        tree.add('')
959
 
        tree.commit('msg1', rev_id='rev1')
960
 
        tree.commit('msg2', rev_id='rev2')
961
 
 
962
 
    def test_log_range(self):
963
 
        self.assertLogRevnos(["-r1..2"], ["2", "1"])
964
 
 
965
 
    def test_log_norange(self):
966
 
        self.assertLogRevnos([], ["2", "1"])
967
 
 
968
 
    def test_log_range_open_begin(self):
969
 
        raise tests.KnownFailure("log with ghosts fails. bug #726466")
970
 
        (stdout, stderr) = self.run_bzr(['log', '-r..2'], retcode=3)
971
 
        self.assertEqual(["2", "1"],
972
 
                         [r.revno for r in self.get_captured_revisions()])
973
 
        self.assertEquals("bzr: ERROR: Further revision history missing.", stderr)
974
 
 
975
 
    def test_log_range_open_end(self):
976
 
        self.assertLogRevnos(["-r1.."], ["2", "1"])