55
55
pb.update("updating git map", i, len(all_revids))
56
56
self._update_sha_map_revision(revid)
61
60
def _update_sha_map_revision(self, revid):
67
66
ie = inv[inv.path2id(path)]
68
67
if ie.kind in ("file", "symlink"):
69
68
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))
73
raise AssertionError()
70
self._idmap.add_entry(sha, "tree", (ie.file_id, ie.revision))
74
71
rev = self.repository.get_revision(revid)
75
72
commit_obj = revision_to_commit(rev, tree_sha, self._idmap._parent_lookup)
76
73
self._idmap.add_entry(commit_obj.sha().hexdigest(), "commit", (revid, tree_sha))
78
75
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
84
76
text = self.repository.texts.get_record_stream([(fileid, revision)], "unordered", True).next().get_bytes_as("fulltext")
89
def _get_tree(self, path, revid):
81
def _get_tree(self, fileid, revid):
90
82
raise NotImplementedError(self._get_tree)
92
84
def _get_commit(self, revid, tree_sha):