/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 converter.py

Partially fix pull.

Show diffs side-by-side

added added

removed removed

Lines of Context:
55
55
                pb.update("updating git map", i, len(all_revids))
56
56
                self._update_sha_map_revision(revid)
57
57
        finally:
58
 
            self._idmap.commit()
59
58
            pb.finished()
60
59
 
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))
72
69
            else:
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))
77
74
 
78
75
    def _get_blob(self, fileid, revision):
79
 
        """Return a Git Blob object from a fileid and revision stored in bzr.
80
 
        
81
 
        :param fileid: File id of the text
82
 
        :param revision: Revision of the text
83
 
        """
84
76
        text = self.repository.texts.get_record_stream([(fileid, revision)], "unordered", True).next().get_bytes_as("fulltext")
85
77
        blob = Blob()
86
78
        blob._text = text
87
79
        return blob
88
80
 
89
 
    def _get_tree(self, path, revid):
 
81
    def _get_tree(self, fileid, revid):
90
82
        raise NotImplementedError(self._get_tree)
91
83
 
92
84
    def _get_commit(self, revid, tree_sha):