diff mercurial/commands.py @ 967:1f3710636b45

[PATCH] Print timezone offset when outputting dates Example: % hg log | head -12 changeset: 791:41440890e57d2dbacde03a2a114e5114a031ea4a tag: tip user: Samuel Tardieu <sam@rfc1149.net> date: Mon Jul 25 13:24:15 2005 +0200 summary: Parse various date formats when accepting user specified dates [...] changeset: 787:ba5c2021364ee876dae170e8f153e43bd0b2bd73 parent: 785:31a80e3723cee0a5991340facb2707e71983eb41 user: Bryan O'Sullivan <bos@serpentine.com> date: Sun Jul 24 00:39:24 2005 -0800 summary: Get "forget" command to use new walk code. [...]
author Samuel Tardieu <sam@rfc1149.net>
date Fri, 19 Aug 2005 23:23:42 -0800
parents 022bcc738389
children a51991ebf229
line wrap: on
line diff
--- a/mercurial/commands.py	Fri Aug 19 23:07:31 2005 -0800
+++ b/mercurial/commands.py	Fri Aug 19 23:23:42 2005 -0800
@@ -222,6 +222,9 @@
 
     changes = changelog.read(changenode)
 
+    t, tz = changes[2].split(' ')
+    date = time.asctime(time.localtime(float(t))) + " %+05d" % (int(tz)/-36)
+
     parents = [(log.rev(p), ui.verbose and hg.hex(p) or hg.short(p))
                for p in log.parents(node)
                if ui.debugflag or p != hg.nullid]
@@ -247,8 +250,7 @@
     ui.debug("manifest:    %d:%s\n" % (repo.manifest.rev(changes[0]),
                                       hg.hex(changes[0])))
     ui.status("user:        %s\n" % changes[1])
-    ui.status("date:        %s\n" % time.asctime(
-        time.localtime(float(changes[2].split(' ')[0]))))
+    ui.status("date:        %s\n" % date)
 
     if ui.debugflag:
         files = repo.changes(changelog.parents(changenode)[0], changenode)