# HG changeset patch # User Sverre Rabbelier # Date 1241971104 25200 # Node ID 302df8a2a8d00d8c0a86dc6e639383170e9becaa # Parent 7c57f15d397cc2a840ffb17bf6a6115df9932530 major speedup in the already-converted case diff -r 7c57f15d397c -r 302df8a2a8d0 git_handler.py --- a/git_handler.py Sun May 10 08:54:47 2009 -0700 +++ b/git_handler.py Sun May 10 08:58:24 2009 -0700 @@ -164,8 +164,9 @@ for i, rev in enumerate(self.repo.changelog): if i%100 == 0: self.ui.status(_("at: %*d/%d\n") % (magnitude, i, total)) - self.export_hg_commit(rev) - self.save_map() + pgit_sha, already_written = self.export_hg_commit(rev) + if not already_written: + self.save_map() # convert this commit into git objects # go through the manifest, convert all blobs/trees we don't have @@ -176,7 +177,7 @@ phgsha = hex(node) pgit_sha = self.map_git_get(phgsha) if pgit_sha: - return pgit_sha + return pgit_sha, True self.ui.status(_("converting revision %s\n") % str(rev)) @@ -233,7 +234,7 @@ commit_sha = self.git.write_commit_hash(commit) # writing new blobs to git self.map_set(commit_sha, phgsha) - return commit_sha + return commit_sha, False def write_git_tree(self, ctx): trees = {}