~bzr-pqm/bzr/bzr.dev

« back to all changes in this revision

Viewing changes to bzrlib/log.py

remove all trailing whitespace from bzr source

Show diffs side-by-side

added added

removed removed

Lines of Context:
267
267
            specific_fileid, view_revisions,
268
268
            include_merges=generate_merge_revisions)
269
269
 
270
 
    # rebase merge_depth - unless there are no revisions or 
 
270
    # rebase merge_depth - unless there are no revisions or
271
271
    # either the first or last revision have merge_depth = 0.
272
272
    if view_revisions and view_revisions[0][2] and view_revisions[-1][2]:
273
273
        min_depth = min([d for r,n,d in view_revisions])
410
410
 
411
411
def _get_mainline_revs(branch, start_revision, end_revision):
412
412
    """Get the mainline revisions from the branch.
413
 
    
 
413
 
414
414
    Generates the list of mainline revisions for the branch.
415
 
    
416
 
    :param  branch: The branch containing the revisions. 
 
415
 
 
416
    :param  branch: The branch containing the revisions.
417
417
 
418
418
    :param  start_revision: The first revision to be logged.
419
419
            For backwards compatibility this may be a mainline integer revno,
429
429
    if branch_revno == 0:
430
430
        return None, None, None, None
431
431
 
432
 
    # For mainline generation, map start_revision and end_revision to 
433
 
    # mainline revnos. If the revision is not on the mainline choose the 
434
 
    # appropriate extreme of the mainline instead - the extra will be 
 
432
    # For mainline generation, map start_revision and end_revision to
 
433
    # mainline revnos. If the revision is not on the mainline choose the
 
434
    # appropriate extreme of the mainline instead - the extra will be
435
435
    # filtered later.
436
436
    # Also map the revisions to rev_ids, to be used in the later filtering
437
437
    # stage.
493
493
def _filter_revision_range(view_revisions, start_rev_id, end_rev_id):
494
494
    """Filter view_revisions based on revision ranges.
495
495
 
496
 
    :param view_revisions: A list of (revision_id, dotted_revno, merge_depth) 
 
496
    :param view_revisions: A list of (revision_id, dotted_revno, merge_depth)
497
497
            tuples to be filtered.
498
498
 
499
499
    :param start_rev_id: If not NONE specifies the first revision to be logged.
517
517
                end_index = revision_ids.index(end_rev_id)
518
518
            else:
519
519
                end_index = len(view_revisions) - 1
520
 
        # To include the revisions merged into the last revision, 
 
520
        # To include the revisions merged into the last revision,
521
521
        # extend end_rev_id down to, but not including, the next rev
522
522
        # with the same or lesser merge_depth
523
523
        end_merge_depth = view_revisions[end_index][2]
689
689
    """A revision to be logged (by LogFormatter.log_revision).
690
690
 
691
691
    A simple wrapper for the attributes of a revision to be logged.
692
 
    The attributes may or may not be populated, as determined by the 
 
692
    The attributes may or may not be populated, as determined by the
693
693
    logging options and the log formatter capabilities.
694
694
    """
695
695
 
710
710
    If the LogFormatter needs to be informed of the beginning or end of
711
711
    a log it should implement the begin_log and/or end_log hook methods.
712
712
 
713
 
    A LogFormatter should define the following supports_XXX flags 
 
713
    A LogFormatter should define the following supports_XXX flags
714
714
    to indicate which LogRevision attributes it supports:
715
715
 
716
716
    - supports_delta must be True if this log formatter supports delta.
717
717
        Otherwise the delta attribute may not be populated.  The 'delta_format'
718
718
        attribute describes whether the 'short_status' format (1) or the long
719
719
        one (2) sould be used.
720
 
 
721
 
    - supports_merge_revisions must be True if this log formatter supports 
 
720
 
 
721
    - supports_merge_revisions must be True if this log formatter supports
722
722
        merge revisions.  If not, and if supports_single_merge_revisions is
723
 
        also not True, then only mainline revisions will be passed to the 
 
723
        also not True, then only mainline revisions will be passed to the
724
724
        formatter.
725
725
    - supports_single_merge_revision must be True if this log formatter
726
726
        supports logging only a single merge revision.  This flag is
732
732
    the properties_handler_registry. The registered function
733
733
    must respect the following interface description:
734
734
        def my_show_properties(properties_dict):
735
 
            # code that returns a dict {'name':'value'} of the properties 
 
735
            # code that returns a dict {'name':'value'} of the properties
736
736
            # to be shown
737
737
    """
738
738
 
747
747
        self.delta_format = delta_format
748
748
 
749
749
# TODO: uncomment this block after show() has been removed.
750
 
# Until then defining log_revision would prevent _show_log calling show() 
 
750
# Until then defining log_revision would prevent _show_log calling show()
751
751
# in legacy formatters.
752
752
#    def log_revision(self, revision):
753
753
#        """Log a revision.
770
770
 
771
771
    def show_properties(self, revision, indent):
772
772
        """Displays the custom properties returned by each registered handler.
773
 
        
 
773
 
774
774
        If a registered handler raises an error it is propagated.
775
775
        """
776
776
        for key, handler in properties_handler_registry.iteritems():