/brz/remove-bazaar

To get this branch, use:
bzr branch http://gegoxaren.bato24.eu/bzr/brz/remove-bazaar

« back to all changes in this revision

Viewing changes to bzrlib/log.py

  • Committer: Ian Clatworthy
  • Date: 2009-01-29 06:18:25 UTC
  • mto: (3970.1.1 ianc-integration)
  • mto: This revision was merged to the branch mainline in revision 3972.
  • Revision ID: ian.clatworthy@canonical.com-20090129061825-8dbbry5u2vg0nwgp
review feedback from vila

Show diffs side-by-side

added added

removed removed

Lines of Context:
196
196
 
197
197
    if specific_fileid:
198
198
        trace.mutter('get log for file_id %r', specific_fileid)
199
 
    levels_to_display = lf.get_levels_to_display()
 
199
    levels_to_display = lf.get_levels()
200
200
    generate_merge_revisions = levels_to_display != 1
201
201
    allow_single_merge_revision = True
202
202
    if not getattr(lf, 'supports_merge_revisions', False):
746
746
            # code that returns a dict {'name':'value'} of the properties 
747
747
            # to be shown
748
748
    """
 
749
    preferred_levels = 0
749
750
 
750
751
    def __init__(self, to_file, show_ids=False, show_timezone='original',
751
752
                 delta_format=None, levels=None):
768
769
        self.delta_format = delta_format
769
770
        self.levels = levels
770
771
 
771
 
    def get_levels_to_display(self):
 
772
    def get_levels(self):
 
773
        """Get the number of levels to display or 0 for all."""
772
774
        if getattr(self, 'supports_merge_revisions', False):
773
775
            if self.levels is None or self.levels == -1:
774
 
                return getattr(self, 'preferred_levels', 0)
 
776
                return self.preferred_levels
775
777
            else:
776
778
                return self.levels
777
779
        return 1
778
780
 
779
 
# TODO: uncomment this block after show() has been removed.
780
 
# Until then defining log_revision would prevent _show_log calling show() 
781
 
# in legacy formatters.
782
 
#    def log_revision(self, revision):
783
 
#        """Log a revision.
784
 
#
785
 
#        :param  revision:   The LogRevision to be logged.
786
 
#        """
787
 
#        raise NotImplementedError('not implemented in abstract base')
 
781
    def log_revision(self, revision):
 
782
        """Log a revision.
 
783
 
 
784
        :param  revision:   The LogRevision to be logged.
 
785
        """
 
786
        raise NotImplementedError('not implemented in abstract base')
788
787
 
789
788
    def short_committer(self, rev):
790
789
        name, address = config.parse_username(rev.committer)
880
879
        revno_width = self.revno_width_by_depth.get(depth)
881
880
        if revno_width is None:
882
881
            if revision.revno.find('.') == -1:
 
882
                # mainline revno, e.g. 12345
883
883
                revno_width = 5
884
884
            else:
885
 
                revno_width = 9
 
885
                # dotted revno, e.g. 12345.10.55
 
886
                revno_width = 11
886
887
            self.revno_width_by_depth[depth] = revno_width
887
888
        offset = ' ' * (revno_width + 1)
888
889