/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_logformats.py

First attempt to merge .dev and resolve the conflicts (but tests are 
failing)

Show diffs side-by-side

added added

removed removed

Lines of Context:
 
1
# Copyright (C) 2005, 2006 Canonical Ltd
 
2
#
 
3
# This program is free software; you can redistribute it and/or modify
 
4
# it under the terms of the GNU General Public License as published by
 
5
# the Free Software Foundation; either version 2 of the License, or
 
6
# (at your option) any later version.
 
7
#
 
8
# This program is distributed in the hope that it will be useful,
 
9
# but WITHOUT ANY WARRANTY; without even the implied warranty of
 
10
# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
 
11
# GNU General Public License for more details.
 
12
#
 
13
# You should have received a copy of the GNU General Public License
 
14
# along with this program; if not, write to the Free Software
 
15
# Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA  02111-1307  USA
1
16
"""Black-box tests for default log_formats/log_formatters
2
17
"""
3
18
 
18
33
 
19
34
        self.bzr('init')
20
35
        open('a', 'wb').write('foo\n')
21
 
        self.bzr('add', 'a')
 
36
        self.bzr('add a')
22
37
 
23
 
        self.bzr('commit', '-m', '1')
 
38
        self.bzr('commit -m 1')
24
39
        open('a', 'wb').write('baz\n')
25
40
 
26
 
        self.bzr('commit', '-m', '2')
 
41
        self.bzr('commit -m 2')
27
42
 
28
43
        # only the lines formatter is this short
29
44
        self.assertEquals(3, len(self.bzr('log').split('\n')))
31
46
    def test_log_format_arg(self):
32
47
        self.bzr('init')
33
48
        open('a', 'wb').write('foo\n')
34
 
        self.bzr('add', 'a')
 
49
        self.bzr('add a')
35
50
 
36
 
        self.bzr('commit', '-m', '1')
 
51
        self.bzr('commit -m 1')
37
52
        open('a', 'wb').write('baz\n')
38
53
 
39
 
        self.bzr('commit', '-m', '2')
 
54
        self.bzr('commit -m 2')
40
55
 
41
56
        # only the lines formatter is this short
42
 
        self.assertEquals(7, len(self.bzr('log', '--log-format', 'short').split('\n')))
 
57
        self.assertEquals(7, len(self.bzr('log --log-format short').split('\n')))
43
58
 
44
59
    def test_missing_default_format(self):
45
60
        self.setup_config()
49
64
        self.bzr('init')
50
65
 
51
66
        open('a', 'wb').write('foo\n')
52
 
        self.bzr('add', 'a')
53
 
        self.bzr('commit', '-m', '1')
 
67
        self.bzr('add a')
 
68
        self.bzr('commit -m 1')
54
69
 
55
70
        os.chdir('..')
56
 
        self.bzr('branch', 'a', 'b')
 
71
        self.bzr('branch a b')
57
72
        os.chdir('a')
58
73
 
59
74
        open('a', 'wb').write('bar\n')
60
 
        self.bzr('commit', '-m', '2')
 
75
        self.bzr('commit -m 2')
61
76
 
62
77
        open('a', 'wb').write('baz\n')
63
 
        self.bzr('commit', '-m', '3')
 
78
        self.bzr('commit -m 3')
64
79
 
65
80
        os.chdir('../b')
66
 
        
 
81
 
67
82
        self.assertEquals(5, len(self.bzr('missing', retcode=1).split('\n')))
68
 
        
 
83
 
69
84
        os.chdir('..')
70
85
 
71
86
    def test_missing_format_arg(self):
76
91
        self.bzr('init')
77
92
 
78
93
        open('a', 'wb').write('foo\n')
79
 
        self.bzr('add', 'a')
80
 
        self.bzr('commit', '-m', '1')
 
94
        self.bzr('add a')
 
95
        self.bzr('commit -m 1')
81
96
 
82
97
        os.chdir('..')
83
 
        self.bzr('branch', 'a', 'b')
 
98
        self.bzr('branch a b')
84
99
        os.chdir('a')
85
100
 
86
101
        open('a', 'wb').write('bar\n')
87
 
        self.bzr('commit', '-m', '2')
 
102
        self.bzr('commit -m 2')
88
103
 
89
104
        open('a', 'wb').write('baz\n')
90
 
        self.bzr('commit', '-m', '3')
 
105
        self.bzr('commit -m 3')
91
106
 
92
107
        os.chdir('../b')
93
 
        
94
 
        self.assertEquals(9, len(self.bzr('missing', '--log-format', 'short', retcode=1).split('\n')))
95
 
        
 
108
 
 
109
        self.assertEquals(9, len(self.bzr('missing --log-format short',
 
110
                                          retcode=1).split('\n')))
 
111
 
96
112
        os.chdir('..')
97
113
 
98
114