169
169
def _prepare(self):
170
170
self.build_tree(['parent/'])
171
self.run_bzr('init', 'parent')
171
self.run_bzr('init parent')
172
172
self.run_bzr(['commit', '-m', 'first post', '--unchanged', 'parent'])
173
self.run_bzr('branch', 'parent', 'child')
173
self.run_bzr('branch parent child')
174
174
self.run_bzr(['commit', '-m', 'branch 1', '--unchanged', 'child'])
175
self.run_bzr('branch', 'child', 'smallerchild')
175
self.run_bzr('branch child smallerchild')
176
176
self.run_bzr(['commit', '-m', 'branch 2', '--unchanged',
178
178
os.chdir('child')
179
self.run_bzr('merge', '../smallerchild')
179
self.run_bzr('merge ../smallerchild')
180
180
self.run_bzr(['commit', '-m', 'merge branch 2'])
181
181
os.chdir('../parent')
182
self.run_bzr('merge', '../child')
182
self.run_bzr('merge ../child')
183
183
self.run_bzr(['commit', '-m', 'merge branch 1'])
185
185
def test_merges_are_indented_by_level(self):
438
438
tree.commit('add file2')
439
439
tree.add('file3')
440
440
tree.commit('add file3')
441
self.run_bzr('branch', 'parent', 'child')
441
self.run_bzr('branch parent child')
442
442
print >> file('child/file2', 'wb'), 'hello'
443
443
self.run_bzr(['commit', '-m', 'branch 1', 'child'])
444
444
os.chdir('parent')
445
self.run_bzr('merge', '../child')
445
self.run_bzr('merge ../child')
446
446
self.run_bzr(['commit', '-m', 'merge child branch'])
447
log = self.run_bzr('log', 'file1')[0]
447
log = self.run_bzr('log file1')[0]
448
448
self.assertContainsRe(log, 'revno: 1\n')
449
449
self.assertNotContainsRe(log, 'revno: 2\n')
450
450
self.assertNotContainsRe(log, 'revno: 3\n')
451
451
self.assertNotContainsRe(log, 'revno: 3.1.1\n')
452
452
self.assertNotContainsRe(log, 'revno: 4\n')
453
log = self.run_bzr('log', 'file2')[0]
453
log = self.run_bzr('log file2')[0]
454
454
self.assertNotContainsRe(log, 'revno: 1\n')
455
455
self.assertContainsRe(log, 'revno: 2\n')
456
456
self.assertNotContainsRe(log, 'revno: 3\n')
457
457
self.assertContainsRe(log, 'revno: 3.1.1\n')
458
458
self.assertContainsRe(log, 'revno: 4\n')
459
log = self.run_bzr('log', 'file3')[0]
459
log = self.run_bzr('log file3')[0]
460
460
self.assertNotContainsRe(log, 'revno: 1\n')
461
461
self.assertNotContainsRe(log, 'revno: 2\n')
462
462
self.assertContainsRe(log, 'revno: 3\n')
463
463
self.assertNotContainsRe(log, 'revno: 3.1.1\n')
464
464
self.assertNotContainsRe(log, 'revno: 4\n')
465
log = self.run_bzr('log', '-r3.1.1', 'file2')[0]
465
log = self.run_bzr('log -r3.1.1 file2')[0]
466
466
self.assertNotContainsRe(log, 'revno: 1\n')
467
467
self.assertNotContainsRe(log, 'revno: 2\n')
468
468
self.assertNotContainsRe(log, 'revno: 3\n')
469
469
self.assertContainsRe(log, 'revno: 3.1.1\n')
470
470
self.assertNotContainsRe(log, 'revno: 4\n')
471
log = self.run_bzr('log', '-r4', 'file2')[0]
472
self.assertNotContainsRe(log, 'revno: 1\n')
473
self.assertNotContainsRe(log, 'revno: 2\n')
474
self.assertNotContainsRe(log, 'revno: 3\n')
475
self.assertContainsRe(log, 'revno: 3.1.1\n')
476
self.assertContainsRe(log, 'revno: 4\n')
477
log = self.run_bzr('log', '-r3..', 'file2')[0]
478
self.assertNotContainsRe(log, 'revno: 1\n')
479
self.assertNotContainsRe(log, 'revno: 2\n')
480
self.assertNotContainsRe(log, 'revno: 3\n')
481
self.assertContainsRe(log, 'revno: 3.1.1\n')
482
self.assertContainsRe(log, 'revno: 4\n')
483
log = self.run_bzr('log', '-r..3', 'file2')[0]
471
log = self.run_bzr('log -r4 file2')[0]
472
self.assertNotContainsRe(log, 'revno: 1\n')
473
self.assertNotContainsRe(log, 'revno: 2\n')
474
self.assertNotContainsRe(log, 'revno: 3\n')
475
self.assertContainsRe(log, 'revno: 3.1.1\n')
476
self.assertContainsRe(log, 'revno: 4\n')
477
log = self.run_bzr('log -r3.. file2')[0]
478
self.assertNotContainsRe(log, 'revno: 1\n')
479
self.assertNotContainsRe(log, 'revno: 2\n')
480
self.assertNotContainsRe(log, 'revno: 3\n')
481
self.assertContainsRe(log, 'revno: 3.1.1\n')
482
self.assertContainsRe(log, 'revno: 4\n')
483
log = self.run_bzr('log -r..3 file2')[0]
484
484
self.assertNotContainsRe(log, 'revno: 1\n')
485
485
self.assertContainsRe(log, 'revno: 2\n')
486
486
self.assertNotContainsRe(log, 'revno: 3\n')