51
51
self.assertTrue('message:\n message3\n' in self.full_log)
53
53
log = self.run_bzr("log -r 1..")[0]
54
self.assertEquals(log, self.full_log)
54
self.assertEqualDiff(log, self.full_log)
56
56
def test_log_null_begin_revspec(self):
58
58
log = self.run_bzr("log -r ..3")[0]
59
self.assertEquals(self.full_log, log)
59
self.assertEqualDiff(self.full_log, log)
61
61
def test_log_null_both_revspecs(self):
63
63
log = self.run_bzr("log -r ..")[0]
64
64
self.assertEquals(self.full_log, log)
65
self.assertEqualDiff(self.full_log, log)
66
67
def test_log_negative_begin_revspec_full_log(self):
68
69
log = self.run_bzr("log -r -3..")[0]
69
self.assertEquals(self.full_log, log)
70
self.assertEqualDiff(self.full_log, log)
71
72
def test_log_negative_both_revspec_full_log(self):
73
74
log = self.run_bzr("log -r -3..-1")[0]
74
self.assertEquals(self.full_log, log)
75
self.assertEqualDiff(self.full_log, log)
76
77
def test_log_negative_both_revspec_partial(self):
156
157
self.assertTrue('revno: 3\n' in log)
159
class TestLogMerges(ExternalBase):
161
def test_merges_are_indented_by_level(self):
162
self.build_tree(['parent/'])
163
self.run_bzr('init', 'parent')
164
self.run_bzr('commit', '-m', 'first post', '--unchanged', 'parent')
165
self.run_bzr('branch', 'parent', 'child')
166
self.run_bzr('commit', '-m', 'branch 1', '--unchanged', 'child')
167
self.run_bzr('branch', 'child', 'smallerchild')
168
self.run_bzr('commit', '-m', 'branch 2', '--unchanged', 'smallerchild')
170
self.run_bzr('merge', '../smallerchild')
171
self.run_bzr('commit', '-m', 'merge branch 2')
172
os.chdir('../parent')
173
self.run_bzr('merge', '../child')
174
self.run_bzr('commit', '-m', 'merge branch 1')
175
out,err = self.run_bzr('log')
176
# the log will look something like:
177
# self.assertEqual("""\
178
#------------------------------------------------------------
180
#committer: Robert Collins <foo@example.com>
182
#timestamp: Tue 2006-03-28 22:31:40 +1100
185
# ------------------------------------------------------------
187
# merged: foo@example.com-20060328113140-91f43cfb46dc2863
188
# committer: Robert Collins <foo@example.com>
190
# timestamp: Tue 2006-03-28 22:31:40 +1100
193
# ------------------------------------------------------------
195
# merged: foo@example.com-20060328113140-1ba24f850a0ef573
196
# committer: Robert Collins <foo@example.com>
197
# branch nick: smallerchild
198
# timestamp: Tue 2006-03-28 22:31:40 +1100
201
# ------------------------------------------------------------
203
# merged: foo@example.com-20060328113140-5749a4757a8ac792
204
# committer: Robert Collins <foo@example.com>
206
# timestamp: Tue 2006-03-28 22:31:40 +1100
209
#------------------------------------------------------------
211
#committer: Robert Collins <foo@example.com>
213
#timestamp: Tue 2006-03-28 22:31:39 +1100
217
# but we dont have a nice pattern matcher hooked up yet, so:
218
# we check for the indenting of the commit message and the
220
self.assertTrue('revno: 2' in out)
221
self.assertTrue(' merge branch 1' in out)
222
self.assertTrue(' revno: 1.1.2' in out)
223
self.assertTrue(' merge branch 2' in out)
224
self.assertTrue(' revno: 1.1.1.1' in out)
225
self.assertTrue(' branch 2' in out)
226
self.assertTrue(' revno: 1.1.1' in out)
227
self.assertTrue(' branch 1' in out)
228
self.assertTrue('revno: 1' in out)
229
self.assertTrue(' first post' in out)
230
self.assertEqual('', err)
233
160
class TestLogEncodings(TestCaseInTempDir):