diff git_handler.py @ 235:912d6a5837c8

reorganize export_hg_commit
author Abderrahim Kitouni <a.kitouni@gmail.com>
date Sun, 02 Aug 2009 19:53:08 +0100
parents 6f34aee64a3f
children 42ae65e6c1d1
line wrap: on
line diff
--- 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())