~bzr-pqm/bzr/bzr.dev

« back to all changes in this revision

Viewing changes to bzrlib/repository.py

  • Committer: Canonical.com Patch Queue Manager
  • Date: 2011-06-19 18:33:40 UTC
  • mfrom: (5972.3.25 get-ancestry-is-evil)
  • Revision ID: pqm@pqm.ubuntu.com-20110619183340-ds1rpql77nxrmo4n
(jelmer) Deprecate Repository.get_ancestry(). (Jelmer Vernooij)

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,
1056
1056
        raise NotImplementedError(self.revision_trees)
1057
1057
 
1058
1058
    @needs_read_lock
 
1059
    @symbol_versioning.deprecated_method(
 
1060
        symbol_versioning.deprecated_in((2, 4, 0)))
1059
1061
    def get_ancestry(self, revision_id, topo_sorted=True):
1060
1062
        """Return a list of revision-ids integrated by a revision.
1061
1063
 
1065
1067
 
1066
1068
        This is topologically sorted.
1067
1069
        """
 
1070
        if 'evil' in debug.debug_flags:
 
1071
            mutter_callsite(2, "get_ancestry is linear with history.")
1068
1072
        if _mod_revision.is_null(revision_id):
1069
1073
            return [None]
1070
1074
        if not self.has_revision(revision_id):