/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 repository.py

Add basic infrastructure for dpush.

Show diffs side-by-side

added added

removed removed

Lines of Context:
21
21
 
22
22
import bzrlib
23
23
from bzrlib import (
24
 
    deprecated_graph,
25
24
    errors,
26
25
    graph,
27
26
    inventory,
29
28
    repository,
30
29
    revision,
31
30
    revisiontree,
 
31
    ui,
32
32
    urlutils,
33
 
    versionedfile,
34
33
    )
35
34
from bzrlib.foreign import (
36
35
        ForeignRepository,
151
150
        ancestry.reverse()
152
151
        return ancestry
153
152
 
 
153
    def import_revision_gist(self, source, revid):
 
154
        pass
 
155
 
 
156
    def dfetch(self, source, stop_revision):
 
157
        if stop_revision is None:
 
158
            raise NotImplementedError
 
159
        revidmap = {}
 
160
        todo = []
 
161
        source.lock_read()
 
162
        try:
 
163
            graph = source.get_graph()
 
164
            for revid, parents in graph.iter_ancestry([stop_revision]):
 
165
                if not self.has_revision(revid):
 
166
                    todo.append(revid)
 
167
            pb = ui.ui_factory.nested_progress_bar()
 
168
            try:
 
169
                for i, revid in enumerate(reversed(todo)):
 
170
                    pb.update("pushing revisions", i, len(todo))
 
171
                    revidmap[revid] = self.import_revision_gist(source, revid)
 
172
            finally:
 
173
                pb.finished()
 
174
        finally:
 
175
            source.unlock()
 
176
        return revidmap
 
177
 
154
178
    def get_signature_text(self, revision_id):
155
179
        raise errors.NoSuchRevision(self, revision_id)
156
180