[PATCH] keyword: do not import time, use util.datestr

Christian Ebert blacktrash at gmx.net
Tue Aug 4 04:09:58 CDT 2009


# HG changeset patch
# User Christian Ebert <blacktrash at gmx.net>
# Date 1249376919 -7200
# Node ID e88c4967f5a14d574e38dfca8dbd86d035a9a2f2
# Parent  b3ff6eeaa84f18327f8755e18a8d83b17a7f9dcf
keyword: do not import time, use util.datestr

diff --git a/hgext/keyword.py b/hgext/keyword.py
--- a/hgext/keyword.py
+++ b/hgext/keyword.py
@@ -81,7 +81,7 @@
 from mercurial.lock import release
 from mercurial.node import nullid
 from mercurial.i18n import _
-import re, shutil, tempfile, time
+import re, shutil, tempfile
 
 commands.optionalrepo += ' kwdemo'
 
@@ -96,7 +96,7 @@
 
 def utcdate(date):
     '''Returns hgdate in cvs-like UTC format.'''
-    return time.strftime('%Y/%m/%d %H:%M:%S', time.gmtime(date[0]))
+    return util.datestr(date, format='%Y/%m/%d %H:%M:%S')
 
 # make keyword tools accessible
 kwtools = {'templater': None, 'hgcmd': '', 'inc': [], 'exc': ['.hg*']}


More information about the Mercurial-devel mailing list