/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: Vincent Ladeuil
  • Date: 2010-07-07 11:21:19 UTC
  • mto: (5193.7.1 unify-confs)
  • mto: This revision was merged to the branch mainline in revision 5349.
  • Revision ID: v.ladeuil+lp@free.fr-20100707112119-jwyh312df41w6l0o
Revert previous change as I can't reproduce the related problem anymore.

Show diffs side-by-side

added added

removed removed

Lines of Context:
70
70
    diff,
71
71
    errors,
72
72
    foreign,
 
73
    osutils,
73
74
    repository as _mod_repository,
74
75
    revision as _mod_revision,
75
76
    revisionspec,
432
433
        else:
433
434
            specific_files = None
434
435
        s = StringIO()
 
436
        path_encoding = osutils.get_diff_header_encoding()
435
437
        diff.show_diff_trees(tree_1, tree_2, s, specific_files, old_label='',
436
 
            new_label='')
 
438
            new_label='', path_encoding=path_encoding)
437
439
        return s.getvalue()
438
440
 
439
441
    def _create_log_revision_iterator(self):
522
524
    elif not generate_merge_revisions:
523
525
        # If we only want to see linear revisions, we can iterate ...
524
526
        iter_revs = _generate_flat_revisions(branch, start_rev_id, end_rev_id,
525
 
                                             direction)
 
527
                                             direction, exclude_common_ancestry)
526
528
        if direction == 'forward':
527
529
            iter_revs = reversed(iter_revs)
528
530
    else:
544
546
        return [(rev_id, revno_str, 0)]
545
547
 
546
548
 
547
 
def _generate_flat_revisions(branch, start_rev_id, end_rev_id, direction):
548
 
    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)
549
554
    # If a start limit was given and it's not obviously an
550
555
    # ancestor of the end limit, check it before outputting anything
551
556
    if direction == 'forward' or (start_rev_id
572
577
    if delayed_graph_generation:
573
578
        try:
574
579
            for rev_id, revno, depth in  _linear_view_revisions(
575
 
                branch, start_rev_id, end_rev_id):
 
580
                branch, start_rev_id, end_rev_id, exclude_common_ancestry):
576
581
                if _has_merges(branch, rev_id):
577
582
                    # The end_rev_id can be nested down somewhere. We need an
578
583
                    # explicit ancestry check. There is an ambiguity here as we
643
648
    return True
644
649
 
645
650
 
646
 
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):
647
653
    """Calculate a sequence of revisions to view, newest to oldest.
648
654
 
649
655
    :param start_rev_id: the lower revision-id
650
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.
651
659
    :return: An iterator of (revision_id, dotted_revno, merge_depth) tuples.
652
660
    :raises _StartNotLinearAncestor: if a start_rev_id is specified but
653
 
      is not found walking the left-hand history
 
661
        is not found walking the left-hand history
654
662
    """
655
663
    br_revno, br_rev_id = branch.last_revision_info()
656
664
    repo = branch.repository
667
675
            revno = branch.revision_id_to_dotted_revno(revision_id)
668
676
            revno_str = '.'.join(str(n) for n in revno)
669
677
            if not found_start and revision_id == start_rev_id:
670
 
                yield revision_id, revno_str, 0
 
678
                if not exclude_common_ancestry:
 
679
                    yield revision_id, revno_str, 0
671
680
                found_start = True
672
681
                break
673
682
            else: