aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorLaurent Bachelier <laurent@bachelier.name>2013-02-17 01:57:56 +0100
committerEric S. Raymond <esr@thyrsus.com>2013-02-22 14:28:41 -0500
commit5095c7ae6c1da1d7eea30fd67add451c91baf9de (patch)
treeba19d5ad2c0693585cc88d6c4ca151ad5ca540d7
parentExtract commit date for SVN (diff)
downloadirker-5095c7ae6c1da1d7eea30fd67add451c91baf9de.tar.xz
Extract commit date for Mercurial
Same as Git, without the last part about timezone though. Signed-off-by: Eric S. Raymond <esr@thyrsus.com>
-rwxr-xr-xirkerhook.py4
1 files changed, 3 insertions, 1 deletions
diff --git a/irkerhook.py b/irkerhook.py
index 6e86b80..63ce932 100755
--- a/irkerhook.py
+++ b/irkerhook.py
@@ -39,7 +39,7 @@ default_channels = "irc://chat.freenode.net/#commits"
version = "1.17"
-import os, sys, commands, socket, urllib, subprocess, locale
+import os, sys, commands, socket, urllib, subprocess, locale, datetime
from pipes import quote as shellquote
try:
import simplejson as json # Faster, also makes us Python-2.5-compatible
@@ -374,6 +374,8 @@ class HgExtractor(GenericExtractor):
commit.rev = '%d:%s' % (ctx.rev(), commit.commit)
commit.branch = ctx.branch()
commit.author = person(ctx.user())
+ commit.author_date = \
+ datetime.datetime.fromtimestamp(ctx.date()[0]).strftime('%Y-%m-%d %H:%M:%S')
commit.logmsg = ctx.description()
# Extract changed files from status against first parent
st = self.repository.status(ctx.p1().node(), ctx.node())