233
232
for index, rev_id in cut_revs:
234
233
rev_nos[rev_id] = index
236
def iter_revisions():
237
revision_ids = [r for s, r, m, e in merge_sorted_revisions]
240
revisions = branch.repository.get_revisions(revision_ids[:num])
241
for revision in revisions:
243
revision_ids = revision_ids[num:]
246
revisions = branch.repository.get_revisions()
247
for revision in revisions:
235
revisions = branch.repository.get_revisions([r for s, r, m, e in
236
merge_sorted_revisions])
249
238
# now we just print all the revisions
250
239
for ((sequence, rev_id, merge_depth, end_of_merge), rev) in \
251
izip(merge_sorted_revisions, iter_revisions()):
240
zip(merge_sorted_revisions, revisions):
254
243
if not searchRE.search(rev.message):
272
261
lf.show_merge(rev, merge_depth)
264
def deltas_for_log_dummy(branch, which_revs):
265
"""Return all the revisions without intermediate deltas.
267
Useful for log commands that won't need the delta information.
270
for revno, revision_id in which_revs:
271
yield revno, branch.get_revision(revision_id), None
274
def deltas_for_log_reverse(branch, which_revs):
275
"""Compute deltas for display in latest-to-earliest order.
281
Sequence of (revno, revision_id) for the subset of history to examine
284
Sequence of (revno, rev, delta)
286
The delta is from the given revision to the next one in the
287
sequence, which makes sense if the log is being displayed from
290
last_revno = last_revision_id = last_tree = None
291
for revno, revision_id in which_revs:
292
this_tree = branch.revision_tree(revision_id)
293
this_revision = branch.get_revision(revision_id)
296
yield last_revno, last_revision, compare_trees(this_tree, last_tree, False)
298
this_tree = EmptyTree(branch.get_root_id())
301
last_revision = this_revision
302
last_tree = this_tree
306
this_tree = EmptyTree(branch.get_root_id())
308
this_revno = last_revno - 1
309
this_revision_id = branch.revision_history()[this_revno]
310
this_tree = branch.revision_tree(this_revision_id)
311
yield last_revno, last_revision, compare_trees(this_tree, last_tree, False)
314
def deltas_for_log_forward(branch, which_revs):
315
"""Compute deltas for display in forward log.
317
Given a sequence of (revno, revision_id) pairs, return
320
The delta is from the given revision to the next one in the
321
sequence, which makes sense if the log is being displayed from
324
last_revno = last_revision_id = last_tree = None
325
prev_tree = EmptyTree(branch.get_root_id())
327
for revno, revision_id in which_revs:
328
this_tree = branch.revision_tree(revision_id)
329
this_revision = branch.get_revision(revision_id)
333
last_tree = EmptyTree(branch.get_root_id())
335
last_revno = revno - 1
336
last_revision_id = branch.revision_history()[last_revno]
337
last_tree = branch.revision_tree(last_revision_id)
339
yield revno, this_revision, compare_trees(last_tree, this_tree, False)
342
last_revision = this_revision
343
last_tree = this_tree
275
346
class LogFormatter(object):
276
347
"""Abstract class to display log messages."""