~bzr-pqm/bzr/bzr.dev

« back to all changes in this revision

Viewing changes to bzrlib/tests/test_log.py

  • Committer: Lukáš Lalinsky
  • Date: 2007-08-16 18:50:22 UTC
  • mto: (2755.1.1 ianc-integration)
  • mto: This revision was merged to the branch mainline in revision 2757.
  • Revision ID: lalinsky@gmail.com-20070816185022-nra7t01mk81d47rm
Rename get_author to get_apparent_author, revert the long log back to displaying the committer.

Show diffs side-by-side

added added

removed removed

Lines of Context:
243
243
 
244
244
    def normalize_log(self,log):
245
245
        """Replaces the variable lines of logs with fixed lines"""
246
 
        author = 'author: Lorem Ipsum <test@example.com>'
247
 
        committer = 'committer: Lorem Ipsum 2 <test2@example.com>'
 
246
        author = 'author: Dolor Sit <test@example.com>'
 
247
        committer = 'committer: Lorem Ipsum <test@example.com>'
248
248
        lines = log.splitlines(True)
249
249
        for idx,line in enumerate(lines):
250
250
            stripped_line = line.lstrip()
281
281
        self.assertEqualDiff(log_contents, '''\
282
282
------------------------------------------------------------
283
283
revno: 1
284
 
author: Lorem Ipsum <test@example.com>
 
284
committer: Lorem Ipsum <test@example.com>
285
285
branch nick: test_verbose_log
286
286
timestamp: Wed 2005-11-23 12:08:27 +1000
287
287
message:
312
312
        self.assertEqualDiff("""\
313
313
------------------------------------------------------------
314
314
revno: 2
315
 
author: Lorem Ipsum <test@example.com>
 
315
committer: Lorem Ipsum <test@example.com>
316
316
branch nick: parent
317
317
timestamp: Just now
318
318
message:
319
319
  merge branch 1
320
320
    ------------------------------------------------------------
321
321
    revno: 1.1.2
322
 
    author: Lorem Ipsum <test@example.com>
 
322
    committer: Lorem Ipsum <test@example.com>
323
323
    branch nick: child
324
324
    timestamp: Just now
325
325
    message:
326
326
      merge branch 2
327
327
        ------------------------------------------------------------
328
328
        revno: 1.1.1.1.1
329
 
        author: Lorem Ipsum <test@example.com>
 
329
        committer: Lorem Ipsum <test@example.com>
330
330
        branch nick: smallerchild
331
331
        timestamp: Just now
332
332
        message:
333
333
          branch 2
334
334
    ------------------------------------------------------------
335
335
    revno: 1.1.1
336
 
    author: Lorem Ipsum <test@example.com>
 
336
    committer: Lorem Ipsum <test@example.com>
337
337
    branch nick: child
338
338
    timestamp: Just now
339
339
    message:
340
340
      branch 1
341
341
------------------------------------------------------------
342
342
revno: 1
343
 
author: Lorem Ipsum <test@example.com>
 
343
committer: Lorem Ipsum <test@example.com>
344
344
branch nick: parent
345
345
timestamp: Just now
346
346
message:
368
368
        self.assertEqualDiff("""\
369
369
------------------------------------------------------------
370
370
revno: 2
371
 
author: Lorem Ipsum <test@example.com>
 
371
committer: Lorem Ipsum <test@example.com>
372
372
branch nick: parent
373
373
timestamp: Just now
374
374
message:
379
379
  f2
380
380
    ------------------------------------------------------------
381
381
    revno: 1.1.1
382
 
    author: Lorem Ipsum <test@example.com>
 
382
    committer: Lorem Ipsum <test@example.com>
383
383
    branch nick: child
384
384
    timestamp: Just now
385
385
    message:
390
390
      f2
391
391
------------------------------------------------------------
392
392
revno: 1
393
 
author: Lorem Ipsum <test@example.com>
 
393
committer: Lorem Ipsum <test@example.com>
394
394
branch nick: parent
395
395
timestamp: Just now
396
396
message:
409
409
        self.assertEqualDiff(sio.getvalue(), """\
410
410
------------------------------------------------------------
411
411
revno: 3
412
 
author: Joe Foo <joe@foo.com>
 
412
committer: Joe Foo <joe@foo.com>
413
413
branch nick: test
414
414
timestamp: Mon 2005-11-21 09:32:56 -0600
415
415
message:
426
426
  message
427
427
------------------------------------------------------------
428
428
revno: 1
429
 
author: Joe Foo <joe@foo.com>
 
429
committer: Joe Foo <joe@foo.com>
430
430
branch nick: test
431
431
timestamp: Mon 2005-11-21 09:24:15 -0600
432
432
message:
433
433
  simple log message
434
434
""")
435
435
 
436
 
    def test_committer_in_log(self):
437
 
        """Log includes the committer's name if it's
438
 
        different from the author.
 
436
    def test_author_in_log(self):
 
437
        """Log includes the author name if it's set in
 
438
        the revision properties
439
439
        """
440
440
        wt = self.make_branch_and_tree('.')
441
441
        b = wt.branch
447
447
                  timezone=36000,
448
448
                  committer='Lorem Ipsum <test@example.com>',
449
449
                  author='John Doe <jdoe@example.com>')
450
 
        wt.commit(message='foo',
451
 
                  timestamp=1132712707,
452
 
                  timezone=36000,
453
 
                  committer='Lorem Ipsum <test@example.com>',
454
 
                  author='Lorem Ipsum <test@example.com>')
455
450
        sio = StringIO()
456
451
        formatter = LongLogFormatter(to_file=sio)
457
452
        show_log(b, formatter)
458
453
        self.assertEqualDiff(sio.getvalue(), '''\
459
454
------------------------------------------------------------
460
 
revno: 2
461
 
author: Lorem Ipsum <test@example.com>
462
 
branch nick: test_author_log
463
 
timestamp: Wed 2005-11-23 12:25:07 +1000
464
 
message:
465
 
  foo
466
 
------------------------------------------------------------
467
455
revno: 1
468
456
author: John Doe <jdoe@example.com>
469
457
committer: Lorem Ipsum <test@example.com>