222
217
if direction == 'reverse':
223
218
start_rev_id, end_rev_id = end_rev_id, start_rev_id
225
legacy_lf = getattr(lf, 'log_revision', None) is None
227
# pre-0.17 formatters use show for mainline revisions.
228
# how should we show merged revisions ?
229
# pre-0.11 api: show_merge
230
# 0.11-0.16 api: show_merge_revno
231
show_merge_revno = getattr(lf, 'show_merge_revno', None)
232
show_merge = getattr(lf, 'show_merge', None)
233
if show_merge is None and show_merge_revno is None:
234
# no merged-revno support
235
generate_merge_revisions = False
237
generate_merge_revisions = True
238
# tell developers to update their code
239
symbol_versioning.warn('LogFormatters should provide log_revision '
240
'instead of show and show_merge_revno since bzr 0.17.',
241
DeprecationWarning, stacklevel=3)
243
generate_merge_revisions = getattr(lf, 'supports_merge_revisions',
220
generate_merge_revisions = getattr(lf, 'supports_merge_revisions', False)
245
221
generate_single_revision = False
246
222
if ((not generate_merge_revisions)
247
223
and ((start_rev_id and (start_rev_id not in rev_nos))
306
282
if not searchRE.search(rev.message):
310
lr = LogRevision(rev, revno, merge_depth, delta,
311
rev_tag_dict.get(rev_id))
314
# support for legacy (pre-0.17) LogFormatters
317
lf.show(revno, rev, delta, rev_tag_dict.get(rev_id))
319
lf.show(revno, rev, delta)
321
if show_merge_revno is None:
322
lf.show_merge(rev, merge_depth)
325
lf.show_merge_revno(rev, merge_depth, revno,
326
rev_tag_dict.get(rev_id))
328
lf.show_merge_revno(rev, merge_depth, revno)
285
lr = LogRevision(rev, revno, merge_depth, delta,
286
rev_tag_dict.get(rev_id))
331
290
if log_count >= limit:
617
576
# raise NotImplementedError('not implemented in abstract base')
619
@deprecated_method(zero_seventeen)
620
def show(self, revno, rev, delta):
621
raise NotImplementedError('not implemented in abstract base')
623
578
def short_committer(self, rev):
624
579
name, address = config.parse_username(rev.committer)
639
594
supports_delta = True
640
595
supports_tags = True
642
@deprecated_method(zero_seventeen)
643
def show(self, revno, rev, delta, tags=None):
644
lr = LogRevision(rev, revno, 0, delta, tags)
645
return self.log_revision(lr)
647
@deprecated_method(zero_seventeen)
648
def show_merge_revno(self, rev, merge_depth, revno, tags=None):
649
"""Show a merged revision rev, with merge_depth and a revno."""
650
lr = LogRevision(rev, revno, merge_depth, tags=tags)
651
return self.log_revision(lr)
653
597
def log_revision(self, revision):
654
598
"""Log a revision, either merged or not."""
655
599
indent = ' ' * revision.merge_depth
695
639
supports_delta = True
696
640
supports_single_merge_revision = True
698
@deprecated_method(zero_seventeen)
699
def show(self, revno, rev, delta):
700
lr = LogRevision(rev, revno, 0, delta)
701
return self.log_revision(lr)
703
642
def log_revision(self, revision):
704
643
to_file = self.to_file
705
644
date_str = format_date(revision.rev.timestamp,
756
695
return rev.message
758
@deprecated_method(zero_seventeen)
759
def show(self, revno, rev, delta):
760
self.to_file.write(self.log_string(revno, rev, terminal_width()-1))
761
self.to_file.write('\n')
763
697
def log_revision(self, revision):
764
698
self.to_file.write(self.log_string(revision.revno, revision.rev,
765
699
self._max_chars))