comparison mercurial/patch.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 588048a6a8d3
children 463df2986814
comparison
equal deleted inserted replaced
36635:4de15c54e59f 36636:c6061cadb400
38 scmutil, 38 scmutil,
39 similar, 39 similar,
40 util, 40 util,
41 vfs as vfsmod, 41 vfs as vfsmod,
42 ) 42 )
43 from .utils import dateutil
43 44
44 diffhelpers = policy.importmod(r'diffhelpers') 45 diffhelpers = policy.importmod(r'diffhelpers')
45 stringio = util.stringio 46 stringio = util.stringio
46 47
47 gitre = re.compile(br'diff --git a/(.*) b/(.*)') 48 gitre = re.compile(br'diff --git a/(.*) b/(.*)')
2667 return 'diff %s %s' % (revinfo, f) 2668 return 'diff %s %s' % (revinfo, f)
2668 2669
2669 def isempty(fctx): 2670 def isempty(fctx):
2670 return fctx is None or fctx.size() == 0 2671 return fctx is None or fctx.size() == 0
2671 2672
2672 date1 = util.datestr(ctx1.date()) 2673 date1 = dateutil.datestr(ctx1.date())
2673 date2 = util.datestr(ctx2.date()) 2674 date2 = dateutil.datestr(ctx2.date())
2674 2675
2675 gitmode = {'l': '120000', 'x': '100755', '': '100644'} 2676 gitmode = {'l': '120000', 'x': '100755', '': '100644'}
2676 2677
2677 if relroot != '' and (repo.ui.configbool('devel', 'all-warnings') 2678 if relroot != '' and (repo.ui.configbool('devel', 'all-warnings')
2678 or repo.ui.configbool('devel', 'check-relroot')): 2679 or repo.ui.configbool('devel', 'check-relroot')):