# HG changeset patch # User Christian Ebert # Date 2009-08-05 15:20:47 # Node ID 6fdd39f52f7f4b974c90bcba4961da2656f01c57 # Parent 2715506d54e4167f150869f747fe39a5edc774b9 keyword: use util.datestr for utcdate filter, expose through variable diff --git a/hgext/keyword.py b/hgext/keyword.py --- a/hgext/keyword.py +++ b/hgext/keyword.py @@ -82,7 +82,7 @@ from mercurial.hgweb import webcommands 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' @@ -95,9 +95,8 @@ nokwcommands = ('add addremove annotate # not when reading filelog, and unexpand when reading from working dir restricted = 'merge record resolve qfold qimport qnew qpush qrefresh qrecord' -def utcdate(date): - '''Returns hgdate in cvs-like UTC format.''' - return time.strftime('%Y/%m/%d %H:%M:%S', time.gmtime(date[0])) +# provide cvs-like UTC date filter +utcdate = lambda x: util.datestr(x, '%Y/%m/%d %H:%M:%S') # make keyword tools accessible kwtools = {'templater': None, 'hgcmd': '', 'inc': [], 'exc': ['.hg*']}