/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

Handle submodules explicitly.

Show diffs side-by-side

added added

removed removed

Lines of Context:
21
21
from dulwich.objects import (
22
22
    Commit,
23
23
    Tag,
 
24
    S_ISGITLINK,
24
25
    )
25
26
from dulwich.object_store import (
26
27
    tree_lookup_path,
167
168
    return ([(old_path, path, file_id, ie)], shamap)
168
169
 
169
170
 
 
171
def import_git_submodule(texts, mapping, path, hexsha, base_inv, parent_id, 
 
172
    revision_id, parent_invs, shagitmap, lookup_object):
 
173
    raise NotImplementedError(import_git_submodule)
 
174
 
 
175
 
170
176
def import_git_tree(texts, mapping, path, hexsha, base_inv, parent_id, 
171
177
    revision_id, parent_invs, shagitmap, lookup_object):
172
178
    """Import a git tree object into a bzr repository.
219
225
            invdelta.extend(subinvdelta)
220
226
            child_modes.update(grandchildmodes)
221
227
            shamap.extend(subshamap)
 
228
        elif S_ISGITLINK(mode): # submodule
 
229
            subinvdelta, grandchildmodes, subshamap = import_git_submodule(
 
230
                    texts, mapping, child_path, child_hexsha, base_inv,
 
231
                    file_id, revision_id, parent_invs, shagitmap, lookup_object)
 
232
            invdelta.extend(subinvdelta)
 
233
            child_modes.update(grandchildmodes)
 
234
            shamap.extend(subshamap)
222
235
        else:
223
236
            subinvdelta, subshamap = import_git_blob(texts, mapping, 
224
237
                    child_path, child_hexsha, base_inv, file_id, revision_id,