482
482
# deprecated; for compatability
483
483
lf = LongLogFormatter(to_file=to_file, show_timezone=show_timezone)
484
484
lf.show(revno, rev, delta)
486
def show_changed_revisions(branch, old_rh, new_rh, to_file=None, log_format='long'):
487
"""Show the change in revision history comparing the old revision history to the new one.
489
:param branch: The branch where the revisions exist
490
:param old_rh: The old revision history
491
:param new_rh: The new revision history
492
:param to_file: A file to write the results to. If None, stdout will be used
498
to_file = codecs.getwriter(bzrlib.user_encoding)(sys.stdout, errors='replace')
499
lf = log_formatter(log_format,
502
show_timezone='original')
504
# This is the first index which is different between
507
for i in xrange(max(len(new_rh),
511
or new_rh[i] != old_rh[i]):
516
to_file.write('Nothing seems to have changed\n')
518
## TODO: It might be nice to do something like show_log
519
## and show the merged entries. But since this is the
520
## removed revisions, it shouldn't be as important
521
if base_idx < len(old_rh):
522
to_file.write('*'*60)
523
to_file.write('\nRemoved Revisions:\n')
524
for i in range(base_idx, len(old_rh)):
525
rev = branch.get_revision(old_rh[i])
526
lf.show(i+1, rev, None)
527
to_file.write('*'*60)
528
to_file.write('\n\n')
529
if base_idx < len(new_rh):
530
to_file.write('Added Revisions:\n')
536
start_revision=base_idx+1,
537
end_revision=len(new_rh),