276
276
from dulwich.objects import Commit
277
277
commit = Commit()
278
commit._tree = tree_sha
278
commit.tree = tree_sha
279
279
for p in rev.parent_ids:
280
280
git_p = parent_lookup(p)
281
281
if git_p is not None:
282
282
assert len(git_p) == 40, "unexpected length for %r" % git_p
283
commit._parents.append(git_p)
284
commit._message = rev.message.encode("utf-8")
285
commit._committer = fix_person_identifier(rev.committer.encode("utf-8"))
286
commit._author = fix_person_identifier(rev.get_apparent_authors()[0].encode("utf-8"))
287
commit._commit_time = long(rev.timestamp)
283
commit.parents.append(git_p)
284
commit.message = rev.message.encode("utf-8")
285
commit.committer = fix_person_identifier(rev.committer.encode("utf-8"))
286
commit.author = fix_person_identifier(rev.get_apparent_authors()[0].encode("utf-8"))
287
commit.commit_time = long(rev.timestamp)
288
288
if 'author-timestamp' in rev.properties:
289
commit._author_time = long(rev.properties['author-timestamp'])
289
commit.author_time = long(rev.properties['author-timestamp'])
291
commit._author_time = commit._commit_time
291
commit.author_time = commit.commit_time
292
292
if 'committer-timezone' in rev.properties:
293
commit._commit_timezone = int(float(rev.properties['commit-timezone']) / .6)
293
commit.commit_timezone = int(float(rev.properties['commit-timezone']) / .6)
295
commit._commit_timezone = int(rev.timezone / .6)
295
commit.commit_timezone = int(rev.timezone / .6)
296
296
if 'author-timezone' in rev.properties:
297
commit._author_timezone = int(float(rev.properties['author-timezone']) / .6)
297
commit.author_timezone = int(float(rev.properties['author-timezone']) / .6)
299
commit._author_timezone = commit._commit_timezone
299
commit.author_timezone = commit.commit_timezone