468
468
# deprecated; for compatability
469
469
lf = LongLogFormatter(to_file=to_file, show_timezone=show_timezone)
470
470
lf.show(revno, rev, delta)
472
def show_changed_revisions(branch, old_rh, new_rh, to_file=None, log_format='long'):
473
"""Show the change in revision history comparing the old revision history to the new one.
475
:param branch: The branch where the revisions exist
476
:param old_rh: The old revision history
477
:param new_rh: The new revision history
478
:param to_file: A file to write the results to. If None, stdout will be used
484
to_file = codecs.getwriter(bzrlib.user_encoding)(sys.stdout, errors='replace')
485
lf = log_formatter(log_format,
488
show_timezone='original')
490
# This is the first index which is different between
493
for i in xrange(max(len(new_rh),
497
or new_rh[i] != old_rh[i]):
502
to_file.write('Nothing seems to have changed\n')
504
## TODO: It might be nice to do something like show_log
505
## and show the merged entries. But since this is the
506
## removed revisions, it shouldn't be as important
507
if base_idx < len(old_rh):
508
to_file.write('*'*60)
509
to_file.write('\nRemoved Revisions:\n')
510
for i in range(base_idx, len(old_rh)):
511
rev = branch.get_revision(old_rh[i])
512
lf.show(i+1, rev, None)
513
to_file.write('*'*60)
514
to_file.write('\n\n')
515
if base_idx < len(new_rh):
516
to_file.write('Added Revisions:\n')
522
start_revision=base_idx+1,
523
end_revision=len(new_rh),