/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

Derive to_location from from_location, simialr to bzr branch.

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()
58
59
            pb.finished()
59
60
 
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))
69
72
            else:
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))
78
81
        blob._text = text
79
82
        return blob
80
83
 
81
 
    def _get_tree(self, fileid, revid):
 
84
    def _get_tree(self, path, revid):
82
85
        raise NotImplementedError(self._get_tree)
83
86
 
84
87
    def _get_commit(self, revid, tree_sha):