272
272
lf.show_merge(rev, merge_depth)
275
def deltas_for_log_dummy(branch, which_revs):
276
"""Return all the revisions without intermediate deltas.
278
Useful for log commands that won't need the delta information.
281
for revno, revision_id in which_revs:
282
yield revno, branch.get_revision(revision_id), None
285
def deltas_for_log_reverse(branch, which_revs):
286
"""Compute deltas for display in latest-to-earliest order.
292
Sequence of (revno, revision_id) for the subset of history to examine
295
Sequence of (revno, rev, delta)
297
The delta is from the given revision to the next one in the
298
sequence, which makes sense if the log is being displayed from
301
last_revno = last_revision_id = last_tree = None
302
for revno, revision_id in which_revs:
303
this_tree = branch.revision_tree(revision_id)
304
this_revision = branch.get_revision(revision_id)
307
yield last_revno, last_revision, compare_trees(this_tree, last_tree, False)
309
this_tree = EmptyTree(branch.get_root_id())
312
last_revision = this_revision
313
last_tree = this_tree
317
this_tree = EmptyTree(branch.get_root_id())
319
this_revno = last_revno - 1
320
this_revision_id = branch.revision_history()[this_revno]
321
this_tree = branch.revision_tree(this_revision_id)
322
yield last_revno, last_revision, compare_trees(this_tree, last_tree, False)
325
def deltas_for_log_forward(branch, which_revs):
326
"""Compute deltas for display in forward log.
328
Given a sequence of (revno, revision_id) pairs, return
331
The delta is from the given revision to the next one in the
332
sequence, which makes sense if the log is being displayed from
335
last_revno = last_revision_id = last_tree = None
336
prev_tree = EmptyTree(branch.get_root_id())
338
for revno, revision_id in which_revs:
339
this_tree = branch.revision_tree(revision_id)
340
this_revision = branch.get_revision(revision_id)
344
last_tree = EmptyTree(branch.get_root_id())
346
last_revno = revno - 1
347
last_revision_id = branch.revision_history()[last_revno]
348
last_tree = branch.revision_tree(last_revision_id)
350
yield revno, this_revision, compare_trees(last_tree, this_tree, False)
353
last_revision = this_revision
354
last_tree = this_tree
357
275
class LogFormatter(object):
358
276
"""Abstract class to display log messages."""