--- a/hgkw/keyword.py Wed Aug 05 17:01:55 2009 +0200
+++ b/hgkw/keyword.py Wed Aug 05 17:18:32 2009 +0200
@@ -90,7 +90,7 @@
from mercurial import localrepo, patch, revlog, templater, util
from mercurial.node import nullid, hex
from mercurial.i18n import gettext as _
-import getopt, os, re, shutil, tempfile, time
+import getopt, os, re, shutil, tempfile
commands.optionalrepo += ' kwdemo'
@@ -103,9 +103,12 @@
# not when reading filelog, and unexpand when reading from working dir
restricted = 'merge record resolve qfold qimport qnew qpush qrefresh qrecord'
+# provide cvs-like UTC date filter
def utcdate(date):
- '''Returns hgdate in cvs-like UTC format.'''
- return time.strftime('%Y/%m/%d %H:%M:%S', time.gmtime(date[0]))
+ try:
+ return util.datestr(date, '%Y/%m/%d %H:%M:%S', False)
+ except TypeError:
+ return util.datestr(date, '%Y/%m/%d %H:%M:%S')
def textsafe(s):
'''Safe version of util.binary with reversed logic.