256
256
def assertUseShortDeltaFormat(self, cmd):
257
257
log = self.run_bzr(cmd)[0]
258
258
# Check that we use the short status format
259
self.assertContainsRe(log, '(?m)^A hello.txt$')
260
self.assertNotContainsRe(log, '(?m)^added:$')
259
self.assertContainsRe(log, '(?m)^\s*A hello.txt$')
260
self.assertNotContainsRe(log, '(?m)^\s*added:$')
262
262
def assertUseLongDeltaFormat(self, cmd):
263
263
log = self.run_bzr(cmd)[0]
264
264
# Check that we use the long status format
265
self.assertNotContainsRe(log, '(?m)^A hello.txt$')
266
self.assertContainsRe(log, '(?m)^added:$')
265
self.assertNotContainsRe(log, '(?m)^\s*A hello.txt$')
266
self.assertContainsRe(log, '(?m)^\s*added:$')
268
268
def test_log_short_verbose(self):
269
269
self.assertUseShortDeltaFormat(['log', '--short', '-v'])
298
298
parent_tree.commit(message='merge branch 1')
299
299
os.chdir('parent')
301
def _prepare_short(self):
302
parent_tree = self.make_branch_and_tree('parent')
303
parent_tree.commit(message='first post',
304
timestamp=1132586700, timezone=36000,
305
committer='Joe Foo <joe@foo.com>')
306
child_tree = parent_tree.bzrdir.sprout('child').open_workingtree()
307
child_tree.commit(message='branch 1',
308
timestamp=1132586800, timezone=36000,
309
committer='Joe Foo <joe@foo.com>')
311
child_tree.bzrdir.sprout('smallerchild').open_workingtree()
312
smaller_tree.commit(message='branch 2',
313
timestamp=1132586900, timezone=36000,
314
committer='Joe Foo <joe@foo.com>')
315
child_tree.merge_from_branch(smaller_tree.branch)
316
child_tree.commit(message='merge branch 2',
317
timestamp=1132587000, timezone=36000,
318
committer='Joe Foo <joe@foo.com>')
319
parent_tree.merge_from_branch(child_tree.branch)
320
parent_tree.commit(message='merge branch 1',
321
timestamp=1132587100, timezone=36000,
322
committer='Joe Foo <joe@foo.com>')
301
325
def test_merges_are_indented_by_level(self):
303
327
out,err = self.run_bzr('log')
368
def test_force_merge_revisions_off(self):
370
out,err = self.run_bzr('log --long -n1')
371
self.assertEqual('', err)
372
log = normalize_log(out)
373
self.assertEqualDiff(log, """\
374
------------------------------------------------------------
376
committer: Lorem Ipsum <test@example.com>
381
------------------------------------------------------------
383
committer: Lorem Ipsum <test@example.com>
390
def test_force_merge_revisions_on(self):
391
self._prepare_short()
392
out,err = self.run_bzr('log --short -n0')
393
self.assertEqual('', err)
394
log = normalize_log(out)
395
self.assertEqualDiff(log, """\
396
2 Joe Foo\t2005-11-22 [merge]
399
1.1.2 Joe Foo\t2005-11-22 [merge]
402
1.2.1 Joe Foo\t2005-11-22
405
1.1.1 Joe Foo\t2005-11-22
408
1 Joe Foo\t2005-11-22
413
def test_force_merge_revisions_N(self):
414
self._prepare_short()
415
out,err = self.run_bzr('log --short -n2')
416
self.assertEqual('', err)
417
log = normalize_log(out)
418
self.assertEqualDiff(log, """\
419
2 Joe Foo\t2005-11-22 [merge]
422
1.1.2 Joe Foo\t2005-11-22 [merge]
425
1.1.1 Joe Foo\t2005-11-22
428
1 Joe Foo\t2005-11-22
344
433
def test_merges_single_merge_rev(self):
346
435
out,err = self.run_bzr('log -r1.1.2')