comparison hgext/patchbomb.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 d478c8cd89d1
children e77cee5de1c7
comparison
equal deleted inserted replaced
36635:4de15c54e59f 36636:c6061cadb400
97 repair, 97 repair,
98 scmutil, 98 scmutil,
99 templater, 99 templater,
100 util, 100 util,
101 ) 101 )
102 from mercurial.utils import dateutil
102 stringio = util.stringio 103 stringio = util.stringio
103 104
104 cmdtable = {} 105 cmdtable = {}
105 command = registrar.command(cmdtable) 106 command = registrar.command(cmdtable)
106 107
663 hint = _("use 'hg push %s %s'") % (publicurl, revhint) 664 hint = _("use 'hg push %s %s'") % (publicurl, revhint)
664 raise error.Abort(msg, hint=hint) 665 raise error.Abort(msg, hint=hint)
665 666
666 # start 667 # start
667 if date: 668 if date:
668 start_time = util.parsedate(date) 669 start_time = dateutil.parsedate(date)
669 else: 670 else:
670 start_time = util.makedate() 671 start_time = dateutil.makedate()
671 672
672 def genmsgid(id): 673 def genmsgid(id):
673 return '<%s.%d@%s>' % (id[:20], int(start_time[0]), 674 return '<%s.%d@%s>' % (id[:20], int(start_time[0]),
674 encoding.strtolocal(socket.getfqdn())) 675 encoding.strtolocal(socket.getfqdn()))
675 676