Mercurial > hg
comparison hgext/churn.py @ 36607: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 | e9bcc2efb7e8 |
children | 543b7b349b2c |
comparison
equal
deleted
inserted
replaced
36606:4de15c54e59f | 36607:c6061cadb400 |
---|---|
21 logcmdutil, | 21 logcmdutil, |
22 patch, | 22 patch, |
23 pycompat, | 23 pycompat, |
24 registrar, | 24 registrar, |
25 scmutil, | 25 scmutil, |
26 util, | |
27 ) | 26 ) |
27 from mercurial.utils import dateutil | |
28 | 28 |
29 cmdtable = {} | 29 cmdtable = {} |
30 command = registrar.command(cmdtable) | 30 command = registrar.command(cmdtable) |
31 # 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 |
32 # extensions which SHIP WITH MERCURIAL. Non-mainline extensions should | 32 # extensions which SHIP WITH MERCURIAL. Non-mainline extensions should |
63 | 63 |
64 state = {'count': 0} | 64 state = {'count': 0} |
65 rate = {} | 65 rate = {} |
66 df = False | 66 df = False |
67 if opts.get('date'): | 67 if opts.get('date'): |
68 df = util.matchdate(opts['date']) | 68 df = dateutil.matchdate(opts['date']) |
69 | 69 |
70 m = scmutil.match(repo[None], pats, opts) | 70 m = scmutil.match(repo[None], pats, opts) |
71 def prep(ctx, fns): | 71 def prep(ctx, fns): |
72 rev = ctx.rev() | 72 rev = ctx.rev() |
73 if df and not df(ctx.date()[0]): # doesn't match date format | 73 if df and not df(ctx.date()[0]): # doesn't match date format |