# HG changeset patch # User Abderrahim Kitouni # Date 1249239188 -3600 # Node ID 912d6a5837c80f26f6ae52a5d262aa7062bd13bf # Parent 6f34aee64a3fb1167de4ab51ab1783839a3b69d2 reorganize export_hg_commit diff -r 6f34aee64a3f -r 912d6a5837c8 git_handler.py --- a/git_handler.py Sun Aug 02 19:12:16 2009 +0100 +++ b/git_handler.py Sun Aug 02 19:53:08 2009 +0100 @@ -225,7 +225,6 @@ if p_node != nullid and not hex(p_node) in self._map_hg: self.export_hg_commit(p_rev) - tree_sha = commit_tree(self.git.object_store, self.iterblobs(ctx)) renames = [] for f in ctx: rename = ctx.filectx(f).renamed() @@ -233,8 +232,6 @@ renames.append((rename[0], f)) commit = Commit() - commit.tree = tree_sha - (time, timezone) = ctx.date() # hg authors might not have emails author = ctx.user() @@ -255,6 +252,8 @@ if 'author' in extra: author = apply_delta(author, extra['author']) + (time, timezone) = ctx.date() + commit.author = author commit.author_time = int(time) commit.author_timezone = -timezone @@ -314,6 +313,9 @@ if git_sha: commit.parents.append(git_sha) + tree_sha = commit_tree(self.git.object_store, self.iterblobs(ctx)) + commit.tree = tree_sha + self.git.object_store.add_object(commit) self.map_set(commit.id, ctx.hex())