619
619
def log_revision(self, revision):
620
620
"""Log a revision, either merged or not."""
621
621
from bzrlib.osutils import format_date
622
indent = ' '*revision.merge_depth
622
indent = ' ' * revision.merge_depth
623
623
to_file = self.to_file
624
print >>to_file, indent+'-' * 60
624
print >>to_file, indent + '-' * 60
625
625
if revision.revno is not None:
626
print >>to_file, indent+'revno:', revision.revno
626
print >>to_file, indent + 'revno:', revision.revno
627
627
if revision.tags:
628
print >>to_file, indent+'tags: %s' % (', '.join(revision.tags))
628
print >>to_file, indent + 'tags: %s' % (', '.join(revision.tags))
629
629
if self.show_ids:
630
print >>to_file, indent+'revision-id:', revision.rev.revision_id
630
print >>to_file, indent + 'revision-id:', revision.rev.revision_id
631
631
for parent_id in revision.rev.parent_ids:
632
print >>to_file, indent+'parent:', parent_id
633
print >>to_file, indent+'committer:', revision.rev.committer
636
print >>to_file, indent+'branch nick: %s' % \
637
revision.rev.properties['branch-nick']
632
print >>to_file, indent + 'parent:', parent_id
633
print >>to_file, indent + 'committer:', revision.rev.committer
635
author = revision.rev.properties.get('author', None)
636
if author is not None:
637
print >>to_file, indent + 'author:', author
639
branch_nick = revision.rev.properties.get('branch-nick', None)
640
if branch_nick is not None:
641
print >>to_file, indent + 'branch nick:', branch_nick
640
643
date_str = format_date(revision.rev.timestamp,
641
644
revision.rev.timezone or 0,
642
645
self.show_timezone)
643
print >>to_file, indent+'timestamp: %s' % date_str
646
print >>to_file, indent + 'timestamp: %s' % date_str
645
print >>to_file, indent+'message:'
648
print >>to_file, indent + 'message:'
646
649
if not revision.rev.message:
647
print >>to_file, indent+' (no message)'
650
print >>to_file, indent + ' (no message)'
649
652
message = revision.rev.message.rstrip('\r\n')
650
653
for l in message.split('\n'):
651
print >>to_file, indent+' ' + l
654
print >>to_file, indent + ' ' + l
652
655
if revision.delta is not None:
653
656
revision.delta.show(to_file, self.show_ids, indent=indent)