224
224
view_revisions = list(get_view_revisions(mainline_revs, rev_nos, branch,
225
225
direction, include_merges=include_merges))
227
use_tags = getattr(lf, 'supports_tags', False)
230
if branch.supports_tags():
231
rev_tag_dict = branch.tags.get_reverse_tag_dict()
227
233
def iter_revisions():
228
234
# r = revision, n = revno, d = merge depth
229
235
revision_ids = [r for r, n, d in view_revisions]
258
264
if merge_depth == 0:
259
265
# a mainline revision.
261
267
if specific_fileid:
262
268
if not delta.touches_file_id(specific_fileid):
266
272
# although we calculated it, throw it away without display
269
lf.show(revno, rev, delta)
276
lf.show(revno, rev, delta, rev_tag_dict.get(rev_id))
278
lf.show(revno, rev, delta)
271
280
if show_merge_revno is None:
272
281
lf.show_merge(rev, merge_depth)
274
lf.show_merge_revno(rev, merge_depth, revno)
284
lf.show_merge_revno(rev, merge_depth, revno,
285
rev_tag_dict.get(rev_id))
287
lf.show_merge_revno(rev, merge_depth, revno)
277
290
def get_view_revisions(mainline_revs, rev_nos, branch, direction,
341
354
def short_committer(self, rev):
342
355
return re.sub('<.*@.*>', '', rev.committer).strip(' ')
345
358
class LongLogFormatter(LogFormatter):
346
def show(self, revno, rev, delta):
347
return self._show_helper(revno=revno, rev=rev, delta=delta)
360
supports_tags = True # must exist and be True
361
# if this log formatter support tags.
362
# .show() and .show_merge_revno() must then accept
363
# the 'tags'-argument with list of tags
365
def show(self, revno, rev, delta, tags=None):
366
return self._show_helper(revno=revno, rev=rev, delta=delta, tags=tags)
349
368
@deprecated_method(zero_eleven)
350
369
def show_merge(self, rev, merge_depth):
351
return self._show_helper(rev=rev, indent=' '*merge_depth, merged=True, delta=None)
370
return self._show_helper(rev=rev, indent=' '*merge_depth,
371
merged=True, delta=None)
353
def show_merge_revno(self, rev, merge_depth, revno):
373
def show_merge_revno(self, rev, merge_depth, revno, tags=None):
354
374
"""Show a merged revision rev, with merge_depth and a revno."""
355
375
return self._show_helper(rev=rev, revno=revno,
356
indent=' '*merge_depth, merged=True, delta=None)
376
indent=' '*merge_depth, merged=True, delta=None, tags=tags)
358
def _show_helper(self, rev=None, revno=None, indent='', merged=False, delta=None):
378
def _show_helper(self, rev=None, revno=None, indent='', merged=False,
379
delta=None, tags=None):
359
380
"""Show a revision, either merged or not."""
360
381
from bzrlib.osutils import format_date
361
382
to_file = self.to_file
362
383
print >>to_file, indent+'-' * 60
363
384
if revno is not None:
364
385
print >>to_file, indent+'revno:', revno
387
print >>to_file, indent+'tags: %s' % (', '.join(tags))
366
389
print >>to_file, indent+'merged:', rev.revision_id
367
390
elif self.show_ids: