~bzr-pqm/bzr/bzr.dev

« back to all changes in this revision

Viewing changes to bzrlib/log.py

  • Committer: Alexander Belchenko
  • Date: 2010-06-17 08:53:15 UTC
  • mfrom: (5300 +trunk)
  • mto: (5303.2.1 integration)
  • mto: This revision was merged to the branch mainline in revision 5305.
  • Revision ID: bialix@ukr.net-20100617085315-hr8186zck57zn35s
merge bzr.dev; fix NEWS

Show diffs side-by-side

added added

removed removed

Lines of Context:
524
524
    elif not generate_merge_revisions:
525
525
        # If we only want to see linear revisions, we can iterate ...
526
526
        iter_revs = _generate_flat_revisions(branch, start_rev_id, end_rev_id,
527
 
                                             direction)
 
527
                                             direction, exclude_common_ancestry)
528
528
        if direction == 'forward':
529
529
            iter_revs = reversed(iter_revs)
530
530
    else:
546
546
        return [(rev_id, revno_str, 0)]
547
547
 
548
548
 
549
 
def _generate_flat_revisions(branch, start_rev_id, end_rev_id, direction):
550
 
    result = _linear_view_revisions(branch, start_rev_id, end_rev_id)
 
549
def _generate_flat_revisions(branch, start_rev_id, end_rev_id, direction,
 
550
                             exclude_common_ancestry=False):
 
551
    result = _linear_view_revisions(
 
552
        branch, start_rev_id, end_rev_id,
 
553
        exclude_common_ancestry=exclude_common_ancestry)
551
554
    # If a start limit was given and it's not obviously an
552
555
    # ancestor of the end limit, check it before outputting anything
553
556
    if direction == 'forward' or (start_rev_id
574
577
    if delayed_graph_generation:
575
578
        try:
576
579
            for rev_id, revno, depth in  _linear_view_revisions(
577
 
                branch, start_rev_id, end_rev_id):
 
580
                branch, start_rev_id, end_rev_id, exclude_common_ancestry):
578
581
                if _has_merges(branch, rev_id):
579
582
                    # The end_rev_id can be nested down somewhere. We need an
580
583
                    # explicit ancestry check. There is an ambiguity here as we
645
648
    return True
646
649
 
647
650
 
648
 
def _linear_view_revisions(branch, start_rev_id, end_rev_id):
 
651
def _linear_view_revisions(branch, start_rev_id, end_rev_id,
 
652
                           exclude_common_ancestry=False):
649
653
    """Calculate a sequence of revisions to view, newest to oldest.
650
654
 
651
655
    :param start_rev_id: the lower revision-id
652
656
    :param end_rev_id: the upper revision-id
 
657
    :param exclude_common_ancestry: Whether the start_rev_id should be part of
 
658
        the iterated revisions.
653
659
    :return: An iterator of (revision_id, dotted_revno, merge_depth) tuples.
654
660
    :raises _StartNotLinearAncestor: if a start_rev_id is specified but
655
 
      is not found walking the left-hand history
 
661
        is not found walking the left-hand history
656
662
    """
657
663
    br_revno, br_rev_id = branch.last_revision_info()
658
664
    repo = branch.repository
669
675
            revno = branch.revision_id_to_dotted_revno(revision_id)
670
676
            revno_str = '.'.join(str(n) for n in revno)
671
677
            if not found_start and revision_id == start_rev_id:
672
 
                yield revision_id, revno_str, 0
 
678
                if not exclude_common_ancestry:
 
679
                    yield revision_id, revno_str, 0
673
680
                found_start = True
674
681
                break
675
682
            else: