147
153
self.runbzr('commit -m merge_branch_1')
148
154
log = self.runbzr("log -r-1")[0]
149
155
self.assertContainsRe(log, r' tags: tag1')
156
log = self.runbzr("log -r3.1.1")[0]
157
self.assertContainsRe(log, r' tags: tag1')
152
160
class TestLogMerges(ExternalBase):
154
def test_merges_are_indented_by_level(self):
155
163
self.build_tree(['parent/'])
156
164
self.run_bzr('init', 'parent')
157
165
self.run_bzr('commit', '-m', 'first post', '--unchanged', 'parent')
218
226
self.assertTrue(' branch 2' in out)
219
227
self.assertTrue(' revno: 1.1.1' in out)
220
228
self.assertTrue(' branch 1' in out)
221
self.assertTrue('revno: 1' in out)
229
self.assertTrue('revno: 1\n' in out)
222
230
self.assertTrue(' first post' in out)
223
231
self.assertEqual('', err)
233
def test_merges_single_merge_rev(self):
235
out,err = self.run_bzr('log', '-r1.1.2')
236
# the log will look something like:
237
# self.assertEqual("""\
238
# ------------------------------------------------------------
240
# committer: Robert Collins <foo@example.com>
242
# timestamp: Tue 2006-03-28 22:31:40 +1100
245
# ------------------------------------------------------------
247
# committer: Robert Collins <foo@example.com>
248
# branch nick: smallerchild
249
# timestamp: Tue 2006-03-28 22:31:40 +1100
253
# but we dont have a nice pattern matcher hooked up yet, so:
254
# we check for the indenting of the commit message and the
256
self.assertTrue('revno: 2' not in out)
257
self.assertTrue(' merge branch 1' not in out)
258
self.assertTrue(' revno: 1.1.2' in out)
259
self.assertTrue(' merge branch 2' in out)
260
self.assertTrue(' revno: 1.1.1.1' in out)
261
self.assertTrue(' branch 2' in out)
262
self.assertTrue(' revno: 1.1.1\n' not in out)
263
self.assertTrue(' branch 1' not in out)
264
self.assertTrue('revno: 1\n' not in out)
265
self.assertTrue(' first post' not in out)
266
self.assertEqual('', err)
268
def test_merges_partial_range(self):
270
out,err = self.run_bzr('log', '-r1.1.1..1.1.2')
271
# the log will look something like:
272
# self.assertEqual("""\
273
# ------------------------------------------------------------
275
# committer: Robert Collins <foo@example.com>
277
# timestamp: Tue 2006-03-28 22:31:40 +1100
280
# ------------------------------------------------------------
282
# committer: Robert Collins <foo@example.com>
283
# branch nick: smallerchild
284
# timestamp: Tue 2006-03-28 22:31:40 +1100
287
# ------------------------------------------------------------
289
# committer: Robert Collins <foo@example.com>
291
# timestamp: Tue 2006-03-28 22:31:40 +1100
295
# but we dont have a nice pattern matcher hooked up yet, so:
296
# we check for the indenting of the commit message and the
298
self.assertTrue('revno: 2' not in out)
299
self.assertTrue(' merge branch 1' not in out)
300
self.assertTrue(' revno: 1.1.2' in out)
301
self.assertTrue(' merge branch 2' in out)
302
self.assertTrue(' revno: 1.1.1.1' in out)
303
self.assertTrue(' branch 2' in out)
304
self.assertTrue(' revno: 1.1.1' in out)
305
self.assertTrue(' branch 1' in out)
306
self.assertTrue('revno: 1\n' not in out)
307
self.assertTrue(' first post' not in out)
308
self.assertEqual('', err)
226
311
class TestLogEncodings(TestCaseInTempDir):
370
455
self.assertContainsRe(log, 'revno: 3\n')
371
456
self.assertNotContainsRe(log, 'revno: 3.1.1\n')
372
457
self.assertNotContainsRe(log, 'revno: 4\n')
458
log = self.run_bzr('log', '-r3.1.1', 'file2')[0]
459
self.assertNotContainsRe(log, 'revno: 1\n')
460
self.assertNotContainsRe(log, 'revno: 2\n')
461
self.assertNotContainsRe(log, 'revno: 3\n')
462
self.assertContainsRe(log, 'revno: 3.1.1\n')
463
self.assertNotContainsRe(log, 'revno: 4\n')
464
log = self.run_bzr('log', '-r4', 'file2')[0]
465
self.assertNotContainsRe(log, 'revno: 1\n')
466
self.assertNotContainsRe(log, 'revno: 2\n')
467
self.assertNotContainsRe(log, 'revno: 3\n')
468
self.assertContainsRe(log, 'revno: 3.1.1\n')
469
self.assertContainsRe(log, 'revno: 4\n')
470
log = self.run_bzr('log', '-r3..', 'file2')[0]
471
self.assertNotContainsRe(log, 'revno: 1\n')
472
self.assertNotContainsRe(log, 'revno: 2\n')
473
self.assertNotContainsRe(log, 'revno: 3\n')
474
self.assertContainsRe(log, 'revno: 3.1.1\n')
475
self.assertContainsRe(log, 'revno: 4\n')
476
log = self.run_bzr('log', '-r..3', 'file2')[0]
477
self.assertNotContainsRe(log, 'revno: 1\n')
478
self.assertContainsRe(log, 'revno: 2\n')
479
self.assertNotContainsRe(log, 'revno: 3\n')
480
self.assertNotContainsRe(log, 'revno: 3.1.1\n')
481
self.assertNotContainsRe(log, 'revno: 4\n')