/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: Andrew Bennetts
  • Date: 2010-04-08 07:01:10 UTC
  • mfrom: (5138 +trunk)
  • mto: This revision was merged to the branch mainline in revision 5141.
  • Revision ID: andrew.bennetts@canonical.com-20100408070110-mnvv0kbbyaj6cqdg
MergeĀ lp:bzr.

Show diffs side-by-side

added added

removed removed

Lines of Context:
553
553
                    # may not raise _StartNotLinearAncestor for a revision that
554
554
                    # is an ancestor but not a *linear* one. But since we have
555
555
                    # loaded the graph to do the check (or calculate a dotted
556
 
                    # revno), we may as well accept to show the log... 
557
 
                    # -- vila 100201
 
556
                    # revno), we may as well accept to show the log...  We need
 
557
                    # the check only if start_rev_id is not None as all
 
558
                    # revisions have _mod_revision.NULL_REVISION as an ancestor
 
559
                    # -- vila 20100319
558
560
                    graph = branch.repository.get_graph()
559
 
                    if not graph.is_ancestor(start_rev_id, end_rev_id):
 
561
                    if (start_rev_id is not None
 
562
                        and not graph.is_ancestor(start_rev_id, end_rev_id)):
560
563
                        raise _StartNotLinearAncestor()
 
564
                    # Since we collected the revisions so far, we need to
 
565
                    # adjust end_rev_id.
561
566
                    end_rev_id = rev_id
562
567
                    break
563
568
                else:
576
581
            raise errors.BzrCommandError('Start revision not found in'
577
582
                ' history of end revision.')
578
583
 
 
584
    # We exit the loop above because we encounter a revision with merges, from
 
585
    # this revision, we need to switch to _graph_view_revisions.
 
586
 
579
587
    # A log including nested merges is required. If the direction is reverse,
580
588
    # we rebase the initial merge depths so that the development line is
581
589
    # shown naturally, i.e. just like it is for linear logging. We can easily
583
591
    # indented at the end seems slightly nicer in that case.
584
592
    view_revisions = chain(iter(initial_revisions),
585
593
        _graph_view_revisions(branch, start_rev_id, end_rev_id,
586
 
        rebase_initial_depths=direction == 'reverse'))
 
594
                              rebase_initial_depths=(direction == 'reverse')))
587
595
    if direction == 'reverse':
588
596
        return view_revisions
589
597
    elif direction == 'forward':
655
663
 
656
664
 
657
665
def _graph_view_revisions(branch, start_rev_id, end_rev_id,
658
 
    rebase_initial_depths=True):
 
666
                          rebase_initial_depths=True):
659
667
    """Calculate revisions to view including merges, newest to oldest.
660
668
 
661
669
    :param branch: the branch
1424
1432
        """
1425
1433
        # Revision comes directly from a foreign repository
1426
1434
        if isinstance(rev, foreign.ForeignRevision):
1427
 
            return self._format_properties(rev.mapping.vcs.show_foreign_revid(rev.foreign_revid))
 
1435
            return self._format_properties(
 
1436
                rev.mapping.vcs.show_foreign_revid(rev.foreign_revid))
1428
1437
 
1429
1438
        # Imported foreign revision revision ids always contain :
1430
1439
        if not ":" in rev.revision_id:
1517
1526
        to_file = self.to_file
1518
1527
        to_file.write("%s%s\n" % (indent, ('\n' + indent).join(lines)))
1519
1528
        if revision.delta is not None:
1520
 
            # We don't respect delta_format for compatibility
1521
 
            revision.delta.show(to_file, self.show_ids, indent=indent,
1522
 
                                short_status=False)
 
1529
            # Use the standard status output to display changes
 
1530
            from bzrlib.delta import report_delta
 
1531
            report_delta(to_file, revision.delta, short_status=False, 
 
1532
                         show_ids=self.show_ids, indent=indent)
1523
1533
        if revision.diff is not None:
1524
1534
            to_file.write(indent + 'diff:\n')
1525
1535
            to_file.flush()
1588
1598
                to_file.write(indent + offset + '%s\n' % (l,))
1589
1599
 
1590
1600
        if revision.delta is not None:
1591
 
            revision.delta.show(to_file, self.show_ids, indent=indent + offset,
1592
 
                                short_status=self.delta_format==1)
 
1601
            # Use the standard status output to display changes
 
1602
            from bzrlib.delta import report_delta
 
1603
            report_delta(to_file, revision.delta, 
 
1604
                         short_status=self.delta_format==1, 
 
1605
                         show_ids=self.show_ids, indent=indent + offset)
1593
1606
        if revision.diff is not None:
1594
1607
            self.show_diff(self.to_exact_file, revision.diff, '      ')
1595
1608
        to_file.write('\n')
1670
1683
                               self.show_timezone,
1671
1684
                               date_fmt='%Y-%m-%d',
1672
1685
                               show_offset=False)
1673
 
        committer_str = revision.rev.committer.replace (' <', '  <')
 
1686
        committer_str = revision.rev.get_apparent_authors()[0].replace (' <', '  <')
1674
1687
        to_file.write('%s  %s\n\n' % (date_str,committer_str))
1675
1688
 
1676
1689
        if revision.delta is not None and revision.delta.has_changed():
2006
2019
        bug_rows = [line.split(' ', 1) for line in bug_lines]
2007
2020
        fixed_bug_urls = [row[0] for row in bug_rows if
2008
2021
                          len(row) > 1 and row[1] == 'fixed']
2009
 
        
 
2022
 
2010
2023
        if fixed_bug_urls:
2011
2024
            return {'fixes bug(s)': ' '.join(fixed_bug_urls)}
2012
2025
    return {}