/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

Fix syntax errors.

Show diffs side-by-side

added added

removed removed

Lines of Context:
130
130
        # path; this may involve adding them more than once.
131
131
        inv = Inventory()
132
132
        def lookup_object(sha):
133
 
            if sha in objects:
134
 
                return objects[sha]
135
 
            return reconstruct_git_object(repo, mapping, sha)
 
133
            # TODO: need to lookup bzr objects as sha..
 
134
            return objects[sha]
136
135
        import_git_tree(repo, mapping, "", tree, inv, lookup_object)
137
136
        repo.add_revision(rev.revision_id, rev, inv)
138
137
 
139
138
 
140
 
def reconstruct_git_commit(repo, rev):
141
 
    raise NotImplementedError(self.reconstruct_git_commit)
142
 
 
143
 
 
144
 
def reconstruct_git_object(repo, mapping, sha):
145
 
    # Commit
146
 
    revid = mapping.revision_id_foreign_to_bzr(sha)
147
 
    try:
148
 
        rev = repo.get_revision(revid)
149
 
    except NoSuchRevision:
150
 
        pass
151
 
    else:
152
 
        return reconstruct_git_commit(rev)
153
 
 
154
 
    # TODO: Tree
155
 
    # TODO: Blob
156
 
    raise KeyError("No such object %s" % sha)
157
 
 
158
 
 
159
139
class InterGitRepository(InterRepository):
160
140
 
161
141
    _matching_repo_format = GitFormat()