115
115
# files that don't exist in either the basis tree or working tree
116
116
# should give an error
117
117
wt = self.make_branch_and_tree('.')
118
out, err = self.run_bzr('log', 'does-not-exist', retcode=3)
118
out, err = self.run_bzr('log does-not-exist', retcode=3)
119
119
self.assertContainsRe(
120
120
err, 'Path does not have any revision history: does-not-exist')
161
161
def test_merges_are_indented_by_level(self):
162
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')
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')
169
169
os.chdir('child')
170
self.run_bzr('merge', '../smallerchild')
171
self.run_bzr('commit', '-m', 'merge branch 2')
170
self.run_bzr('merge ../smallerchild')
171
self.run_bzr('commit -m merge_branch_2')
172
172
os.chdir('../parent')
173
self.run_bzr('merge', '../child')
174
self.run_bzr('commit', '-m', 'merge branch 1')
173
self.run_bzr('merge ../child')
174
self.run_bzr('commit -m merge_branch_1')
175
175
out,err = self.run_bzr('log')
176
176
# the log will look something like:
177
177
# self.assertEqual("""\
218
218
# we check for the indenting of the commit message and the
219
219
# revision numbers
220
220
self.assertTrue('revno: 2' in out)
221
self.assertTrue(' merge branch 1' in out)
221
self.assertTrue(' merge_branch_1' in out)
222
222
self.assertTrue(' revno: 1.1.2' in out)
223
self.assertTrue(' merge branch 2' in out)
223
self.assertTrue(' merge_branch_2' in out)
224
224
self.assertTrue(' revno: 1.1.1.1' in out)
225
self.assertTrue(' branch 2' in out)
225
self.assertTrue(' branch_2' in out)
226
226
self.assertTrue(' revno: 1.1.1' in out)
227
self.assertTrue(' branch 1' in out)
227
self.assertTrue(' branch_1' in out)
228
228
self.assertTrue('revno: 1' in out)
229
self.assertTrue(' first post' in out)
229
self.assertTrue(' first_post' in out)
230
230
self.assertEqual('', err)
263
263
bzr = self.run_bzr
265
265
open('a', 'wb').write('some stuff\n')
267
bzr('commit', '-m', self._message)
267
bzr(['commit', '-m', self._message])
269
269
def try_encoding(self, encoding, fail=False):
270
270
bzr = self.run_bzr
313
313
self.build_tree(['a'])
315
bzr('commit', '-m', u'\u0422\u0435\u0441\u0442')
315
bzr(['commit', '-m', u'\u0422\u0435\u0441\u0442'])
316
316
stdout, stderr = self.run_bzr('log', encoding='cp866')
318
318
message = stdout.splitlines()[-1]
341
341
tree.commit('revision 1')
342
342
tree.bzrdir.destroy_workingtree()
343
self.run_bzr('log', 'tree/file')
343
self.run_bzr('log tree/file')
345
345
def test_log_file(self):
346
346
"""The log for a particular file should only list revs for that file"""
352
352
tree.commit('add file2')
353
353
tree.add('file3')
354
354
tree.commit('add file3')
355
self.run_bzr('branch', 'parent', 'child')
355
self.run_bzr('branch parent child')
356
356
print >> file('child/file2', 'wb'), 'hello'
357
self.run_bzr('commit', '-m', 'branch 1', 'child')
357
self.run_bzr('commit -m branch_1 child')
358
358
os.chdir('parent')
359
self.run_bzr('merge', '../child')
360
self.run_bzr('commit', '-m', 'merge child branch')
359
self.run_bzr('merge ../child')
360
self.run_bzr('commit -m merge_child_branch')
362
log = self.run_bzr('log', 'file1')[0]
362
log = self.run_bzr('log file1')[0]
363
363
self.assertContainsRe(log, 'revno: 1\n')
364
364
self.assertNotContainsRe(log, 'revno: 2\n')
365
365
self.assertNotContainsRe(log, 'revno: 3\n')
366
366
self.assertNotContainsRe(log, 'revno: 3.1.1\n')
367
367
self.assertNotContainsRe(log, 'revno: 4\n')
368
log = self.run_bzr('log', 'file2')[0]
368
log = self.run_bzr('log file2')[0]
369
369
self.assertNotContainsRe(log, 'revno: 1\n')
370
370
self.assertContainsRe(log, 'revno: 2\n')
371
371
self.assertNotContainsRe(log, 'revno: 3\n')
372
372
self.assertContainsRe(log, 'revno: 3.1.1\n')
373
373
self.assertContainsRe(log, 'revno: 4\n')
374
log = self.run_bzr('log', 'file3')[0]
374
log = self.run_bzr('log file3')[0]
375
375
self.assertNotContainsRe(log, 'revno: 1\n')
376
376
self.assertNotContainsRe(log, 'revno: 2\n')
377
377
self.assertContainsRe(log, 'revno: 3\n')