/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

Try to import nothing other than __init__ when not opening git repositories.

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,
24
25
    errors,
25
26
    graph,
26
27
    inventory,
28
29
    repository,
29
30
    revision,
30
31
    revisiontree,
31
 
    ui,
32
32
    urlutils,
 
33
    versionedfile,
33
34
    )
34
35
from bzrlib.foreign import (
35
36
        ForeignRepository,
41
42
    versionedfiles,
42
43
    )
43
44
from bzrlib.plugins.git.mapping import default_mapping, mapping_registry
44
 
from bzrlib.plugins.git.versionedfiles import GitTexts
45
45
 
46
46
import dulwich as git
47
47
 
95
95
        self.texts = None
96
96
        self.signatures = versionedfiles.VirtualSignatureTexts(self)
97
97
        self.revisions = versionedfiles.VirtualRevisionTexts(self)
98
 
        self.inventories = versionedfiles.VirtualInventoryTexts(self)
99
 
        self.texts = GitTexts(self)
100
98
        self.tags = GitTags(self._git.get_tags())
101
99
 
102
100
    def all_revision_ids(self):
150
148
        ancestry.reverse()
151
149
        return ancestry
152
150
 
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
 
 
178
151
    def get_signature_text(self, revision_id):
179
152
        raise errors.NoSuchRevision(self, revision_id)
180
153