~bzr-pqm/bzr/bzr.dev

« back to all changes in this revision

Viewing changes to bzrlib/graph_walker.py

  • Committer: Aaron Bentley
  • Date: 2007-05-26 17:28:51 UTC
  • mto: This revision was merged to the branch mainline in revision 2534.
  • Revision ID: aaron.bentley@utoronto.ca-20070526172851-k9vmpi5eerfaocg3
fix iteration stuff

Show diffs side-by-side

added added

removed removed

Lines of Context:
171
171
        self.seen.update(self._lines)
172
172
        return self._lines
173
173
 
174
 
    def make_iterator(self):
175
 
        while True:
176
 
            yield self.next()
 
174
    def __iter__(self):
 
175
        return self
177
176
 
178
177
    def find_seen_ancestors(self, revision):
179
178
        """Find ancstors of this revision that have already been seen."""
180
179
        walker = _AncestryWalker(revision, self._graph_walker)
181
180
        seen_ancestors = set()
182
 
        for ancestors in walker.make_iterator():
 
181
        for ancestors in walker:
183
182
            for ancestor in ancestors:
184
183
                if ancestor not in self.seen:
185
184
                    walker.stop_tracing_any([ancestor])