changeset 45652:d1759b2e1888

churn: leverage logcmdutil to filter revisions by --date
author Yuya Nishihara <yuya@tcha.org>
date Mon, 21 Sep 2020 12:36:17 +0900
parents c7413ffe0402
children a357688e3c9c
files hgext/churn.py
diffstat 1 files changed, 1 insertions(+), 7 deletions(-) [+]
line wrap: on
line diff
--- a/hgext/churn.py	Thu Sep 10 18:57:31 2020 +0900
+++ b/hgext/churn.py	Mon Sep 21 12:36:17 2020 +0900
@@ -24,7 +24,6 @@
     pycompat,
     registrar,
 )
-from mercurial.utils import dateutil
 
 cmdtable = {}
 command = registrar.command(cmdtable)
@@ -71,15 +70,9 @@
         _(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 @@
         pats=pats,
         opts=opts,
         revspec=opts[b'rev'],
+        date=opts[b'date'],
         include_pats=opts[b'include'],
         exclude_pats=opts[b'exclude'],
     )