/brz/remove-bazaar

To get this branch, use:
bzr branch http://gegoxaren.bato24.eu/bzr/brz/remove-bazaar

« back to all changes in this revision

Viewing changes to fetch.py

Add simple tests and docstrings for GraphWalker.

Show diffs side-by-side

added added

removed removed

Lines of Context:
36
36
 
37
37
 
38
38
class BzrFetchGraphWalker(object):
 
39
    """GraphWalker implementation that uses a Bazaar repository."""
39
40
 
40
41
    def __init__(self, repository, mapping):
41
42
        self.repository = repository
44
45
        self.heads = set(repository.all_revision_ids())
45
46
        self.parents = {}
46
47
 
 
48
    def __iter__(self):
 
49
        return iter(self.next, None)
 
50
 
47
51
    def ack(self, sha):
48
52
        revid = self.mapping.revision_id_foreign_to_bzr(sha)
49
53
        self.remove(revid)