# HG changeset patch # User Yuya Nishihara # Date 2020-09-21 03:36:17 # Node ID d1759b2e18889eb2f58e9d348f45d76af047ba08 # Parent c7413ffe04021d8264596503c8b17fe55e250c09 churn: leverage logcmdutil to filter revisions by --date diff --git a/hgext/churn.py b/hgext/churn.py --- a/hgext/churn.py +++ b/hgext/churn.py @@ -24,7 +24,6 @@ from mercurial import ( pycompat, registrar, ) -from mercurial.utils import dateutil cmdtable = {} command = registrar.command(cmdtable) @@ -71,15 +70,9 @@ def countrate(ui, repo, amap, *pats, **o _(b'analyzing'), unit=_(b'revisions'), total=len(repo) ) rate = {} - df = False - if opts.get(b'date'): - df = dateutil.matchdate(opts[b'date']) def prep(ctx, fmatch): rev = ctx.rev() - if df and not df(ctx.date()[0]): # doesn't match date format - return - key = getkey(ctx).strip() key = amap.get(key, key) # alias remap if opts.get(b'changesets'): @@ -100,6 +93,7 @@ def countrate(ui, repo, amap, *pats, **o pats=pats, opts=opts, revspec=opts[b'rev'], + date=opts[b'date'], include_pats=opts[b'include'], exclude_pats=opts[b'exclude'], )