bzr branch
http://gegoxaren.bato24.eu/bzr/brz/remove-bazaar
| 
1540.2.6
by Robey Pointer
 make 'log' and 'status' treat '-r N..' as implicitly '-r N..-1'  | 
1  | 
# Copyright (C) 2005 by Canonical Ltd
 | 
2  | 
# -*- coding: utf-8 -*-
 | 
|
3  | 
||
4  | 
# This program is free software; you can redistribute it and/or modify
 | 
|
5  | 
# it under the terms of the GNU General Public License as published by
 | 
|
6  | 
# the Free Software Foundation; either version 2 of the License, or
 | 
|
7  | 
# (at your option) any later version.
 | 
|
8  | 
||
9  | 
# This program is distributed in the hope that it will be useful,
 | 
|
10  | 
# but WITHOUT ANY WARRANTY; without even the implied warranty of
 | 
|
11  | 
# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
 | 
|
12  | 
# GNU General Public License for more details.
 | 
|
13  | 
||
14  | 
# You should have received a copy of the GNU General Public License
 | 
|
15  | 
# along with this program; if not, write to the Free Software
 | 
|
16  | 
# Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA  02111-1307  USA
 | 
|
17  | 
||
18  | 
||
19  | 
"""Black-box tests for bzr log.
 | 
|
20  | 
"""
 | 
|
21  | 
||
22  | 
||
23  | 
from bzrlib.tests.blackbox import ExternalBase  | 
|
24  | 
||
25  | 
||
26  | 
class TestLog(ExternalBase):  | 
|
27  | 
||
| 
1553.4.2
by Michael Ellerman
 Make bzr log -r .. work, fixes bug #4609. Add a bunch of tests to make sure  | 
28  | 
def _prepare(self):  | 
| 
1540.2.6
by Robey Pointer
 make 'log' and 'status' treat '-r N..' as implicitly '-r N..-1'  | 
29  | 
self.runbzr("init")  | 
| 
1553.4.2
by Michael Ellerman
 Make bzr log -r .. work, fixes bug #4609. Add a bunch of tests to make sure  | 
30  | 
self.build_tree(['hello.txt', 'goodbye.txt', 'meep.txt'])  | 
| 
1540.2.6
by Robey Pointer
 make 'log' and 'status' treat '-r N..' as implicitly '-r N..-1'  | 
31  | 
self.runbzr("add hello.txt")  | 
| 
1553.4.2
by Michael Ellerman
 Make bzr log -r .. work, fixes bug #4609. Add a bunch of tests to make sure  | 
32  | 
self.runbzr("commit -m message1 hello.txt")  | 
33  | 
self.runbzr("add goodbye.txt")  | 
|
34  | 
self.runbzr("commit -m message2 goodbye.txt")  | 
|
35  | 
self.runbzr("add meep.txt")  | 
|
36  | 
self.runbzr("commit -m message3 meep.txt")  | 
|
37  | 
self.full_log = self.runbzr("log")[0]  | 
|
38  | 
||
39  | 
def test_log_null_end_revspec(self):  | 
|
40  | 
self._prepare()  | 
|
41  | 
self.assertTrue('revno: 1\n' in self.full_log)  | 
|
42  | 
self.assertTrue('revno: 2\n' in self.full_log)  | 
|
43  | 
self.assertTrue('revno: 3\n' in self.full_log)  | 
|
44  | 
self.assertTrue('message:\n message1\n' in self.full_log)  | 
|
45  | 
self.assertTrue('message:\n message2\n' in self.full_log)  | 
|
46  | 
self.assertTrue('message:\n message3\n' in self.full_log)  | 
|
47  | 
||
48  | 
log = self.runbzr("log -r 1..")[0]  | 
|
49  | 
self.assertEquals(log, self.full_log)  | 
|
50  | 
||
51  | 
def test_log_null_begin_revspec(self):  | 
|
52  | 
self._prepare()  | 
|
53  | 
log = self.runbzr("log -r ..3")[0]  | 
|
54  | 
self.assertEquals(self.full_log, log)  | 
|
55  | 
||
56  | 
def test_log_null_both_revspecs(self):  | 
|
57  | 
self._prepare()  | 
|
58  | 
log = self.runbzr("log -r ..")[0]  | 
|
59  | 
self.assertEquals(self.full_log, log)  | 
|
60  | 
||
61  | 
def test_log_negative_begin_revspec_full_log(self):  | 
|
62  | 
self._prepare()  | 
|
63  | 
log = self.runbzr("log -r -3..")[0]  | 
|
64  | 
self.assertEquals(self.full_log, log)  | 
|
65  | 
||
66  | 
def test_log_negative_both_revspec_full_log(self):  | 
|
67  | 
self._prepare()  | 
|
68  | 
log = self.runbzr("log -r -3..-1")[0]  | 
|
69  | 
self.assertEquals(self.full_log, log)  | 
|
70  | 
||
71  | 
def test_log_negative_both_revspec_partial(self):  | 
|
72  | 
self._prepare()  | 
|
73  | 
log = self.runbzr("log -r -3..-2")[0]  | 
|
74  | 
self.assertTrue('revno: 1\n' in log)  | 
|
75  | 
self.assertTrue('revno: 2\n' in log)  | 
|
76  | 
self.assertTrue('revno: 3\n' not in log)  | 
|
77  | 
||
78  | 
def test_log_negative_begin_revspec(self):  | 
|
79  | 
self._prepare()  | 
|
80  | 
log = self.runbzr("log -r -2..")[0]  | 
|
81  | 
self.assertTrue('revno: 1\n' not in log)  | 
|
82  | 
self.assertTrue('revno: 2\n' in log)  | 
|
83  | 
self.assertTrue('revno: 3\n' in log)  | 
|
84  | 
||
85  | 
def test_log_postive_revspecs(self):  | 
|
86  | 
self._prepare()  | 
|
87  | 
log = self.runbzr("log -r 1..3")[0]  | 
|
88  | 
self.assertEquals(self.full_log, log)  |