292
292
yield rev_id, rev_nos.get(rev_id), merge_depth
295
def deltas_for_log_dummy(branch, which_revs):
296
"""Return all the revisions without intermediate deltas.
298
Useful for log commands that won't need the delta information.
301
for revno, revision_id in which_revs:
302
yield revno, branch.get_revision(revision_id), None
305
def deltas_for_log_reverse(branch, which_revs):
306
"""Compute deltas for display in latest-to-earliest order.
312
Sequence of (revno, revision_id) for the subset of history to examine
315
Sequence of (revno, rev, delta)
317
The delta is from the given revision to the next one in the
318
sequence, which makes sense if the log is being displayed from
321
last_revno = last_revision_id = last_tree = None
322
for revno, revision_id in which_revs:
323
this_tree = branch.revision_tree(revision_id)
324
this_revision = branch.get_revision(revision_id)
327
yield last_revno, last_revision, compare_trees(this_tree, last_tree, False)
329
this_tree = EmptyTree(branch.get_root_id())
332
last_revision = this_revision
333
last_tree = this_tree
337
this_tree = EmptyTree(branch.get_root_id())
339
this_revno = last_revno - 1
340
this_revision_id = branch.revision_history()[this_revno]
341
this_tree = branch.revision_tree(this_revision_id)
342
yield last_revno, last_revision, compare_trees(this_tree, last_tree, False)
345
def deltas_for_log_forward(branch, which_revs):
346
"""Compute deltas for display in forward log.
348
Given a sequence of (revno, revision_id) pairs, return
351
The delta is from the given revision to the next one in the
352
sequence, which makes sense if the log is being displayed from
355
last_revno = last_revision_id = last_tree = None
356
prev_tree = EmptyTree(branch.get_root_id())
358
for revno, revision_id in which_revs:
359
this_tree = branch.revision_tree(revision_id)
360
this_revision = branch.get_revision(revision_id)
364
last_tree = EmptyTree(branch.get_root_id())
366
last_revno = revno - 1
367
last_revision_id = branch.revision_history()[last_revno]
368
last_tree = branch.revision_tree(last_revision_id)
370
yield revno, this_revision, compare_trees(last_tree, this_tree, False)
373
last_revision = this_revision
374
last_tree = this_tree
377
295
class LogFormatter(object):
378
296
"""Abstract class to display log messages."""