~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: 2010-09-17 09:12:11 UTC
  • mfrom: (5430.1.2 merge-2.2-into-devel)
  • Revision ID: pqm@pqm.ubuntu.com-20100917091211-1e9h9nf6bsdjr6bd
(spiv) Merge lp:bzr/2.2, including fixes for #625574, #636930,
        #254278.

Show diffs side-by-side

added added

removed removed

Lines of Context:
2511
2511
            ancestors will be traversed.
2512
2512
        """
2513
2513
        graph = self.get_graph()
2514
 
        stop_revisions = (None, _mod_revision.NULL_REVISION)
2515
 
        return graph.iter_lefthand_ancestry(revision_id, stop_revisions)
 
2514
        next_id = revision_id
 
2515
        while True:
 
2516
            if next_id in (None, _mod_revision.NULL_REVISION):
 
2517
                return
 
2518
            try:
 
2519
                parents = graph.get_parent_map([next_id])[next_id]
 
2520
            except KeyError:
 
2521
                raise errors.RevisionNotPresent(next_id, self)
 
2522
            yield next_id
 
2523
            if len(parents) == 0:
 
2524
                return
 
2525
            else:
 
2526
                next_id = parents[0]
2516
2527
 
2517
2528
    def is_shared(self):
2518
2529
        """Return True if this repository is flagged as a shared repository."""