55
55
pb.update("updating git map", i, len(all_revids))
56
56
self._update_sha_map_revision(revid)
60
61
def _update_sha_map_revision(self, revid):
66
67
ie = inv[inv.path2id(path)]
67
68
if ie.kind in ("file", "symlink"):
68
69
self._idmap.add_entry(sha, "blob", (ie.file_id, ie.revision))
70
elif ie.kind == "directory":
71
self._idmap.add_entry(sha, "tree", (path, ie.revision))
70
self._idmap.add_entry(sha, "tree", (ie.file_id, ie.revision))
73
raise AssertionError()
71
74
rev = self.repository.get_revision(revid)
72
75
commit_obj = revision_to_commit(rev, tree_sha, self._idmap._parent_lookup)
73
76
self._idmap.add_entry(commit_obj.sha().hexdigest(), "commit", (revid, tree_sha))
75
78
def _get_blob(self, fileid, revision):
79
"""Return a Git Blob object from a fileid and revision stored in bzr.
81
:param fileid: File id of the text
82
:param revision: Revision of the text
76
84
text = self.repository.texts.get_record_stream([(fileid, revision)], "unordered", True).next().get_bytes_as("fulltext")
81
def _get_tree(self, fileid, revid):
89
def _get_tree(self, path, revid):
82
90
raise NotImplementedError(self._get_tree)
84
92
def _get_commit(self, revid, tree_sha):