~bzr-pqm/bzr/bzr.dev

« back to all changes in this revision

Viewing changes to bzrlib/repository.py

  • Committer: Jelmer Vernooij
  • Date: 2011-06-16 15:26:58 UTC
  • mto: This revision was merged to the branch mainline in revision 5987.
  • Revision ID: jelmer@samba.org-20110616152658-suye3v65hrtskz1w
Use iter_ancestry in gather_stats.

Show diffs side-by-side

added added

removed removed

Lines of Context:
522
522
        if revid and committers:
523
523
            result['committers'] = 0
524
524
        if revid and revid != _mod_revision.NULL_REVISION:
 
525
            graph = self.get_graph()
525
526
            if committers:
526
527
                all_committers = set()
527
 
            revisions = self.get_ancestry(revid)
528
 
            # pop the leading None
529
 
            revisions.pop(0)
530
 
            first_revision = None
 
528
            revisions = [r for (r, p) in graph.iter_ancestry([revid])
 
529
                        if r != _mod_revision.NULL_REVISION]
 
530
            last_revision = None
531
531
            if not committers:
532
532
                # ignore the revisions in the middle - just grab first and last
533
533
                revisions = revisions[0], revisions[-1]
534
534
            for revision in self.get_revisions(revisions):
535
 
                if not first_revision:
536
 
                    first_revision = revision
 
535
                if not last_revision:
 
536
                    last_revision = revision
537
537
                if committers:
538
538
                    all_committers.add(revision.committer)
539
 
            last_revision = revision
 
539
            first_revision = revision
540
540
            if committers:
541
541
                result['committers'] = len(all_committers)
542
542
            result['firstrev'] = (first_revision.timestamp,