comparison mercurial/ui.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 04c319a07c7b
children 8988c34bd018
comparison
equal deleted inserted replaced
36635:4de15c54e59f 36636:c6061cadb400
35 pycompat, 35 pycompat,
36 rcutil, 36 rcutil,
37 scmutil, 37 scmutil,
38 util, 38 util,
39 ) 39 )
40 from .utils import dateutil
40 41
41 urlreq = util.urlreq 42 urlreq = util.urlreq
42 43
43 # for use with str.translate(None, _keepalnum), to keep just alphanumerics 44 # for use with str.translate(None, _keepalnum), to keep just alphanumerics
44 _keepalnum = ''.join(c for c in map(pycompat.bytechr, range(256)) 45 _keepalnum = ''.join(c for c in map(pycompat.bytechr, range(256))
712 >>> u.setconfig(s, b'date', b'0 0') 713 >>> u.setconfig(s, b'date', b'0 0')
713 >>> u.configdate(s, b'date') 714 >>> u.configdate(s, b'date')
714 (0, 0) 715 (0, 0)
715 """ 716 """
716 if self.config(section, name, default, untrusted): 717 if self.config(section, name, default, untrusted):
717 return self.configwith(util.parsedate, section, name, default, 718 return self.configwith(dateutil.parsedate, section, name, default,
718 'date', untrusted) 719 'date', untrusted)
719 if default is _unset: 720 if default is _unset:
720 return None 721 return None
721 return default 722 return default
722 723