174
191
def test_merges_are_indented_by_level(self):
176
193
out,err = self.run_bzr('log')
177
# the log will look something like:
178
# self.assertEqual("""\
179
#------------------------------------------------------------
181
#committer: Robert Collins <foo@example.com>
183
#timestamp: Tue 2006-03-28 22:31:40 +1100
186
# ------------------------------------------------------------
188
# committer: Robert Collins <foo@example.com>
190
# timestamp: Tue 2006-03-28 22:31:40 +1100
193
# ------------------------------------------------------------
195
# committer: Robert Collins <foo@example.com>
196
# branch nick: smallerchild
197
# timestamp: Tue 2006-03-28 22:31:40 +1100
200
# ------------------------------------------------------------
202
# committer: Robert Collins <foo@example.com>
204
# timestamp: Tue 2006-03-28 22:31:40 +1100
207
#------------------------------------------------------------
209
#committer: Robert Collins <foo@example.com>
211
#timestamp: Tue 2006-03-28 22:31:39 +1100
215
# but we dont have a nice pattern matcher hooked up yet, so:
216
# we check for the indenting of the commit message and the
218
self.assertTrue('revno: 2' in out)
219
self.assertTrue(' merge branch 1' in out)
220
self.assertTrue(' revno: 1.1.2' in out)
221
self.assertTrue(' merge branch 2' in out)
222
self.assertTrue(' revno: 1.1.1.1' in out)
223
self.assertTrue(' branch 2' in out)
224
self.assertTrue(' revno: 1.1.1' in out)
225
self.assertTrue(' branch 1' in out)
226
self.assertTrue('revno: 1\n' in out)
227
self.assertTrue(' first post' in out)
228
194
self.assertEqual('', err)
195
log = normalize_log(out)
196
self.assertEqualDiff(log, """\
197
------------------------------------------------------------
199
committer: Lorem Ipsum <test@example.com>
204
------------------------------------------------------------
206
committer: Lorem Ipsum <test@example.com>
211
------------------------------------------------------------
213
committer: Lorem Ipsum <test@example.com>
214
branch nick: smallerchild
218
------------------------------------------------------------
220
committer: Lorem Ipsum <test@example.com>
225
------------------------------------------------------------
227
committer: Lorem Ipsum <test@example.com>
230
234
def test_merges_single_merge_rev(self):
232
236
out,err = self.run_bzr('log -r1.1.2')
233
# the log will look something like:
234
# self.assertEqual("""\
235
#------------------------------------------------------------
237
#committer: Robert Collins <foo@example.com>
239
#timestamp: Tue 2006-03-28 22:31:40 +1100
242
# ------------------------------------------------------------
244
# committer: Robert Collins <foo@example.com>
245
# branch nick: smallerchild
246
# timestamp: Tue 2006-03-28 22:31:40 +1100
250
# but we dont have a nice pattern matcher hooked up yet, so:
251
# we check for the indenting of the commit message and the
253
self.assertTrue('revno: 2' not in out)
254
self.assertTrue(' merge branch 1' not in out)
255
self.assertTrue('revno: 1.1.2' in out)
256
self.assertTrue(' merge branch 2' in out)
257
self.assertTrue(' revno: 1.1.1.1' in out)
258
self.assertTrue(' branch 2' in out)
259
self.assertTrue('revno: 1.1.1\n' not in out)
260
self.assertTrue(' branch 1' not in out)
261
self.assertTrue('revno: 1\n' not in out)
262
self.assertTrue(' first post' not in out)
263
237
self.assertEqual('', err)
238
log = normalize_log(out)
239
self.assertEqualDiff(log, """\
240
------------------------------------------------------------
242
committer: Lorem Ipsum <test@example.com>
247
------------------------------------------------------------
249
committer: Lorem Ipsum <test@example.com>
250
branch nick: smallerchild
265
256
def test_merges_partial_range(self):
267
258
out,err = self.run_bzr('log -r1.1.1..1.1.2')
268
# the log will look something like:
269
# self.assertEqual("""\
270
#------------------------------------------------------------
272
#committer: Robert Collins <foo@example.com>
274
#timestamp: Tue 2006-03-28 22:31:40 +1100
277
# ------------------------------------------------------------
279
# committer: Robert Collins <foo@example.com>
280
# branch nick: smallerchild
281
# timestamp: Tue 2006-03-28 22:31:40 +1100
284
#------------------------------------------------------------
286
#committer: Robert Collins <foo@example.com>
288
#timestamp: Tue 2006-03-28 22:31:40 +1100
292
# but we dont have a nice pattern matcher hooked up yet, so:
293
# we check for the indenting of the commit message and the
295
self.assertTrue('revno: 2' not in out)
296
self.assertTrue(' merge branch 1' not in out)
297
self.assertTrue('revno: 1.1.2' in out)
298
self.assertTrue(' merge branch 2' in out)
299
self.assertTrue(' revno: 1.1.1.1' in out)
300
self.assertTrue(' branch 2' in out)
301
self.assertTrue('revno: 1.1.1' in out)
302
self.assertTrue(' branch 1' in out)
303
self.assertTrue('revno: 1\n' not in out)
304
self.assertTrue(' first post' not in out)
305
259
self.assertEqual('', err)
260
log = normalize_log(out)
261
self.assertEqualDiff(log, """\
262
------------------------------------------------------------
264
committer: Lorem Ipsum <test@example.com>
269
------------------------------------------------------------
271
committer: Lorem Ipsum <test@example.com>
272
branch nick: smallerchild
276
------------------------------------------------------------
278
committer: Lorem Ipsum <test@example.com>
285
def test_merges_nonsupporting_formatter(self):
287
err_msg = 'Selected log formatter only supports mainline revisions.'
288
out,err = self.run_bzr('log --short -r1.1.2', retcode=3)
289
self.assertContainsRe(err, err_msg)
290
out,err = self.run_bzr('log --short -r1..1.1.2', retcode=3)
291
self.assertContainsRe(err, err_msg)
292
out,err = self.run_bzr('log --short -r1.1.1..1.1.2', retcode=3)
293
self.assertContainsRe(err, err_msg)
308
296
class TestLogEncodings(TestCaseInTempDir):