174
210
def test_merges_are_indented_by_level(self):
176
212
out,err = self.run_bzr('log')
177
# the log will look something like:
178
# self.assertEqual("""\
179
#------------------------------------------------------------
181
#committer: Robert Collins <foo@example.com>
183
#timestamp: Tue 2006-03-28 22:31:40 +1100
186
# ------------------------------------------------------------
188
# committer: Robert Collins <foo@example.com>
190
# timestamp: Tue 2006-03-28 22:31:40 +1100
193
# ------------------------------------------------------------
195
# committer: Robert Collins <foo@example.com>
196
# branch nick: smallerchild
197
# timestamp: Tue 2006-03-28 22:31:40 +1100
200
# ------------------------------------------------------------
202
# committer: Robert Collins <foo@example.com>
204
# timestamp: Tue 2006-03-28 22:31:40 +1100
207
#------------------------------------------------------------
209
#committer: Robert Collins <foo@example.com>
211
#timestamp: Tue 2006-03-28 22:31:39 +1100
215
# but we dont have a nice pattern matcher hooked up yet, so:
216
# we check for the indenting of the commit message and the
218
self.assertTrue('revno: 2' in out)
219
self.assertTrue(' merge branch 1' in out)
220
self.assertTrue(' revno: 1.1.2' in out)
221
self.assertTrue(' merge branch 2' in out)
222
self.assertTrue(' revno: 1.1.1.1' in out)
223
self.assertTrue(' branch 2' in out)
224
self.assertTrue(' revno: 1.1.1' in out)
225
self.assertTrue(' branch 1' in out)
226
self.assertTrue('revno: 1\n' in out)
227
self.assertTrue(' first post' in out)
228
213
self.assertEqual('', err)
214
log = normalize_log(out)
215
self.assertEqualDiff(log, """\
216
------------------------------------------------------------
218
committer: Lorem Ipsum <test@example.com>
223
------------------------------------------------------------
225
committer: Lorem Ipsum <test@example.com>
230
------------------------------------------------------------
232
committer: Lorem Ipsum <test@example.com>
233
branch nick: smallerchild
237
------------------------------------------------------------
239
committer: Lorem Ipsum <test@example.com>
244
------------------------------------------------------------
246
committer: Lorem Ipsum <test@example.com>
230
253
def test_merges_single_merge_rev(self):
232
255
out,err = self.run_bzr('log -r1.1.2')
233
# the log will look something like:
234
# self.assertEqual("""\
235
#------------------------------------------------------------
237
#committer: Robert Collins <foo@example.com>
239
#timestamp: Tue 2006-03-28 22:31:40 +1100
242
# ------------------------------------------------------------
244
# committer: Robert Collins <foo@example.com>
245
# branch nick: smallerchild
246
# timestamp: Tue 2006-03-28 22:31:40 +1100
250
# but we dont have a nice pattern matcher hooked up yet, so:
251
# we check for the indenting of the commit message and the
253
self.assertTrue('revno: 2' not in out)
254
self.assertTrue(' merge branch 1' not in out)
255
self.assertTrue('revno: 1.1.2' in out)
256
self.assertTrue(' merge branch 2' in out)
257
self.assertTrue(' revno: 1.1.1.1' in out)
258
self.assertTrue(' branch 2' in out)
259
self.assertTrue('revno: 1.1.1\n' not in out)
260
self.assertTrue(' branch 1' not in out)
261
self.assertTrue('revno: 1\n' not in out)
262
self.assertTrue(' first post' not in out)
263
256
self.assertEqual('', err)
257
log = normalize_log(out)
258
self.assertEqualDiff(log, """\
259
------------------------------------------------------------
261
committer: Lorem Ipsum <test@example.com>
266
------------------------------------------------------------
268
committer: Lorem Ipsum <test@example.com>
269
branch nick: smallerchild
265
275
def test_merges_partial_range(self):
267
277
out,err = self.run_bzr('log -r1.1.1..1.1.2')
268
# the log will look something like:
269
# self.assertEqual("""\
270
#------------------------------------------------------------
272
#committer: Robert Collins <foo@example.com>
274
#timestamp: Tue 2006-03-28 22:31:40 +1100
277
# ------------------------------------------------------------
279
# committer: Robert Collins <foo@example.com>
280
# branch nick: smallerchild
281
# timestamp: Tue 2006-03-28 22:31:40 +1100
284
#------------------------------------------------------------
286
#committer: Robert Collins <foo@example.com>
288
#timestamp: Tue 2006-03-28 22:31:40 +1100
292
# but we dont have a nice pattern matcher hooked up yet, so:
293
# we check for the indenting of the commit message and the
295
self.assertTrue('revno: 2' not in out)
296
self.assertTrue(' merge branch 1' not in out)
297
self.assertTrue('revno: 1.1.2' in out)
298
self.assertTrue(' merge branch 2' in out)
299
self.assertTrue(' revno: 1.1.1.1' in out)
300
self.assertTrue(' branch 2' in out)
301
self.assertTrue('revno: 1.1.1' in out)
302
self.assertTrue(' branch 1' in out)
303
self.assertTrue('revno: 1\n' not in out)
304
self.assertTrue(' first post' not in out)
305
278
self.assertEqual('', err)
279
log = normalize_log(out)
280
self.assertEqualDiff(log, """\
281
------------------------------------------------------------
283
committer: Lorem Ipsum <test@example.com>
288
------------------------------------------------------------
290
committer: Lorem Ipsum <test@example.com>
291
branch nick: smallerchild
295
------------------------------------------------------------
297
committer: Lorem Ipsum <test@example.com>
304
def test_merges_nonsupporting_formatter(self):
306
err_msg = 'Selected log formatter only supports mainline revisions.'
307
# The single revision case is tested in the core tests
308
# since all standard formatters support single merge revisions.
309
out,err = self.run_bzr('log --short -r1..1.1.2', retcode=3)
310
self.assertContainsRe(err, err_msg)
311
out,err = self.run_bzr('log --short -r1.1.1..1.1.2', retcode=3)
312
self.assertContainsRe(err, err_msg)
308
315
class TestLogEncodings(TestCaseInTempDir):