--- a/hgext/convert/darcs.py Thu Feb 08 23:27:24 2018 +0530
+++ b/hgext/convert/darcs.py Thu Feb 15 17:18:26 2018 +0100
@@ -16,6 +16,7 @@
error,
util,
)
+from mercurial.utils import dateutil
from . import common
NoRepo = common.NoRepo
@@ -148,12 +149,14 @@
def getcommit(self, rev):
elt = self.changes[rev]
- date = util.strdate(elt.get('local_date'), '%a %b %d %H:%M:%S %Z %Y')
+ dateformat = '%a %b %d %H:%M:%S %Z %Y'
+ date = dateutil.strdate(elt.get('local_date'), dateformat)
desc = elt.findtext('name') + '\n' + elt.findtext('comment', '')
# etree can return unicode objects for name, comment, and author,
# so recode() is used to ensure str objects are emitted.
+ newdateformat = '%Y-%m-%d %H:%M:%S %1%2'
return common.commit(author=self.recode(elt.get('author')),
- date=util.datestr(date, '%Y-%m-%d %H:%M:%S %1%2'),
+ date=dateutil.datestr(date, newdateformat),
desc=self.recode(desc).strip(),
parents=self.parents[rev])