comparison hgext/fetch.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 a56bf5591918
children c303d65d2e34
comparison
equal deleted inserted replaced
36635:4de15c54e59f 36636:c6061cadb400
21 lock, 21 lock,
22 pycompat, 22 pycompat,
23 registrar, 23 registrar,
24 util, 24 util,
25 ) 25 )
26 from mercurial.utils import dateutil
26 27
27 release = lock.release 28 release = lock.release
28 cmdtable = {} 29 cmdtable = {}
29 command = registrar.command(cmdtable) 30 command = registrar.command(cmdtable)
30 # Note for extension authors: ONLY specify testedwith = 'ships-with-hg-core' for 31 # Note for extension authors: ONLY specify testedwith = 'ships-with-hg-core' for
62 ''' 63 '''
63 64
64 opts = pycompat.byteskwargs(opts) 65 opts = pycompat.byteskwargs(opts)
65 date = opts.get('date') 66 date = opts.get('date')
66 if date: 67 if date:
67 opts['date'] = util.parsedate(date) 68 opts['date'] = dateutil.parsedate(date)
68 69
69 parent, _p2 = repo.dirstate.parents() 70 parent, _p2 = repo.dirstate.parents()
70 branch = repo.dirstate.branch() 71 branch = repo.dirstate.branch()
71 try: 72 try:
72 branchnode = repo.branchtip(branch) 73 branchnode = repo.branchtip(branch)