Mercurial > public > mercurial-scm > hg-stable
comparison mercurial/formatter.py @ 36636:c6061cadb400
util: extract all date-related utils in utils/dateutil module
With this commit, util.py lose 262 lines
Note for extensions author, if this commit breaks your extension, you can pull
the step-by-step split here to help you more easily pinpoint the renaming that
broke your extension:
hg pull https://bitbucket.org/octobus/mercurial-devel/ -r ac1f6453010d
Differential Revision: https://phab.mercurial-scm.org/D2282
author | Boris Feld <boris.feld@octobus.net> |
---|---|
date | Thu, 15 Feb 2018 17:18:26 +0100 |
parents | e8d37838f5df |
children | 034a07e60e98 |
comparison
equal
deleted
inserted
replaced
36635:4de15c54e59f | 36636:c6061cadb400 |
---|---|
124 templatefilters, | 124 templatefilters, |
125 templatekw, | 125 templatekw, |
126 templater, | 126 templater, |
127 util, | 127 util, |
128 ) | 128 ) |
129 from .utils import dateutil | |
129 | 130 |
130 pickle = util.pickle | 131 pickle = util.pickle |
131 | 132 |
132 class _nullconverter(object): | 133 class _nullconverter(object): |
133 '''convert non-primitive data types to be processed by formatter''' | 134 '''convert non-primitive data types to be processed by formatter''' |
241 storecontext = False | 242 storecontext = False |
242 | 243 |
243 @staticmethod | 244 @staticmethod |
244 def formatdate(date, fmt): | 245 def formatdate(date, fmt): |
245 '''stringify date tuple in the given format''' | 246 '''stringify date tuple in the given format''' |
246 return util.datestr(date, fmt) | 247 return dateutil.datestr(date, fmt) |
247 @staticmethod | 248 @staticmethod |
248 def formatdict(data, key, value, fmt, sep): | 249 def formatdict(data, key, value, fmt, sep): |
249 '''stringify key-value pairs separated by sep''' | 250 '''stringify key-value pairs separated by sep''' |
250 return sep.join(fmt % (k, v) for k, v in _iteritems(data)) | 251 return sep.join(fmt % (k, v) for k, v in _iteritems(data)) |
251 @staticmethod | 252 @staticmethod |