~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-24 08:18:19 UTC
  • mfrom: (5365.6.10 annotate-revspec)
  • Revision ID: pqm@pqm.ubuntu.com-20100924081819-5b3m10xulgg6d3cv
(spiv) Add 'mainline' and 'annotate' revision specs. (Aaron Bentley) (Andrew
 Bennetts)

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
 
        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]
 
2514
        stop_revisions = (None, _mod_revision.NULL_REVISION)
 
2515
        return graph.iter_lefthand_ancestry(revision_id, stop_revisions)
2527
2516
 
2528
2517
    def is_shared(self):
2529
2518
        """Return True if this repository is flagged as a shared repository."""