156
164
self.assertTrue('revno: 2\n' in log)
157
165
self.assertTrue('revno: 3\n' in log)
167
class TestLogMerges(ExternalBase):
170
self.build_tree(['parent/'])
171
self.run_bzr('init', 'parent')
172
self.run_bzr('commit', '-m', 'first post', '--unchanged', 'parent')
173
self.run_bzr('branch', 'parent', 'child')
174
self.run_bzr('commit', '-m', 'branch 1', '--unchanged', 'child')
175
self.run_bzr('branch', 'child', 'smallerchild')
176
self.run_bzr('commit', '-m', 'branch 2', '--unchanged', 'smallerchild')
178
self.run_bzr('merge', '../smallerchild')
179
self.run_bzr('commit', '-m', 'merge branch 2')
180
os.chdir('../parent')
181
self.run_bzr('merge', '../child')
182
self.run_bzr('commit', '-m', 'merge branch 1')
184
def test_merges_are_indented_by_level(self):
186
out,err = self.run_bzr('log')
187
# the log will look something like:
188
# self.assertEqual("""\
189
#------------------------------------------------------------
191
#committer: Robert Collins <foo@example.com>
193
#timestamp: Tue 2006-03-28 22:31:40 +1100
196
# ------------------------------------------------------------
198
# committer: Robert Collins <foo@example.com>
200
# timestamp: Tue 2006-03-28 22:31:40 +1100
203
# ------------------------------------------------------------
205
# committer: Robert Collins <foo@example.com>
206
# branch nick: smallerchild
207
# timestamp: Tue 2006-03-28 22:31:40 +1100
210
# ------------------------------------------------------------
212
# committer: Robert Collins <foo@example.com>
214
# timestamp: Tue 2006-03-28 22:31:40 +1100
217
#------------------------------------------------------------
219
#committer: Robert Collins <foo@example.com>
221
#timestamp: Tue 2006-03-28 22:31:39 +1100
225
# but we dont have a nice pattern matcher hooked up yet, so:
226
# we check for the indenting of the commit message and the
228
self.assertTrue('revno: 2' in out)
229
self.assertTrue(' merge branch 1' in out)
230
self.assertTrue(' revno: 1.1.2' in out)
231
self.assertTrue(' merge branch 2' in out)
232
self.assertTrue(' revno: 1.1.1.1' in out)
233
self.assertTrue(' branch 2' in out)
234
self.assertTrue(' revno: 1.1.1' in out)
235
self.assertTrue(' branch 1' in out)
236
self.assertTrue('revno: 1\n' in out)
237
self.assertTrue(' first post' in out)
238
self.assertEqual('', err)
240
def test_merges_single_merge_rev(self):
242
out,err = self.run_bzr('log', '-r1.1.2')
243
# the log will look something like:
244
# self.assertEqual("""\
245
# ------------------------------------------------------------
247
# committer: Robert Collins <foo@example.com>
249
# timestamp: Tue 2006-03-28 22:31:40 +1100
252
# ------------------------------------------------------------
254
# committer: Robert Collins <foo@example.com>
255
# branch nick: smallerchild
256
# timestamp: Tue 2006-03-28 22:31:40 +1100
260
# but we dont have a nice pattern matcher hooked up yet, so:
261
# we check for the indenting of the commit message and the
263
self.assertTrue('revno: 2' not in out)
264
self.assertTrue(' merge branch 1' not in out)
265
self.assertTrue(' revno: 1.1.2' in out)
266
self.assertTrue(' merge branch 2' in out)
267
self.assertTrue(' revno: 1.1.1.1' in out)
268
self.assertTrue(' branch 2' in out)
269
self.assertTrue(' revno: 1.1.1\n' not in out)
270
self.assertTrue(' branch 1' not in out)
271
self.assertTrue('revno: 1\n' not in out)
272
self.assertTrue(' first post' not in out)
273
self.assertEqual('', err)
275
def test_merges_partial_range(self):
277
out,err = self.run_bzr('log', '-r1.1.1..1.1.2')
278
# the log will look something like:
279
# self.assertEqual("""\
280
# ------------------------------------------------------------
282
# committer: Robert Collins <foo@example.com>
284
# timestamp: Tue 2006-03-28 22:31:40 +1100
287
# ------------------------------------------------------------
289
# committer: Robert Collins <foo@example.com>
290
# branch nick: smallerchild
291
# timestamp: Tue 2006-03-28 22:31:40 +1100
294
# ------------------------------------------------------------
296
# committer: Robert Collins <foo@example.com>
298
# timestamp: Tue 2006-03-28 22:31:40 +1100
302
# but we dont have a nice pattern matcher hooked up yet, so:
303
# we check for the indenting of the commit message and the
305
self.assertTrue('revno: 2' not in out)
306
self.assertTrue(' merge branch 1' not in out)
307
self.assertTrue(' revno: 1.1.2' in out)
308
self.assertTrue(' merge branch 2' in out)
309
self.assertTrue(' revno: 1.1.1.1' in out)
310
self.assertTrue(' branch 2' in out)
311
self.assertTrue(' revno: 1.1.1' in out)
312
self.assertTrue(' branch 1' in out)
313
self.assertTrue('revno: 1\n' not in out)
314
self.assertTrue(' first post' not in out)
315
self.assertEqual('', err)
160
318
class TestLogEncodings(TestCaseInTempDir):
304
462
self.assertContainsRe(log, 'revno: 3\n')
305
463
self.assertNotContainsRe(log, 'revno: 3.1.1\n')
306
464
self.assertNotContainsRe(log, 'revno: 4\n')
465
log = self.run_bzr('log', '-r3.1.1', 'file2')[0]
466
self.assertNotContainsRe(log, 'revno: 1\n')
467
self.assertNotContainsRe(log, 'revno: 2\n')
468
self.assertNotContainsRe(log, 'revno: 3\n')
469
self.assertContainsRe(log, 'revno: 3.1.1\n')
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]
484
self.assertNotContainsRe(log, 'revno: 1\n')
485
self.assertContainsRe(log, 'revno: 2\n')
486
self.assertNotContainsRe(log, 'revno: 3\n')
487
self.assertNotContainsRe(log, 'revno: 3.1.1\n')
488
self.assertNotContainsRe(log, 'revno: 4\n')