##// END OF EJS Templates
churn: leverage logcmdutil to filter revisions by --date
Yuya Nishihara -
r46229:d1759b2e default
parent child Browse files
Show More
@@ -24,7 +24,6 b' from mercurial import ('
24 pycompat,
24 pycompat,
25 registrar,
25 registrar,
26 )
26 )
27 from mercurial.utils import dateutil
28
27
29 cmdtable = {}
28 cmdtable = {}
30 command = registrar.command(cmdtable)
29 command = registrar.command(cmdtable)
@@ -71,15 +70,9 b' def countrate(ui, repo, amap, *pats, **o'
71 _(b'analyzing'), unit=_(b'revisions'), total=len(repo)
70 _(b'analyzing'), unit=_(b'revisions'), total=len(repo)
72 )
71 )
73 rate = {}
72 rate = {}
74 df = False
75 if opts.get(b'date'):
76 df = dateutil.matchdate(opts[b'date'])
77
73
78 def prep(ctx, fmatch):
74 def prep(ctx, fmatch):
79 rev = ctx.rev()
75 rev = ctx.rev()
80 if df and not df(ctx.date()[0]): # doesn't match date format
81 return
82
83 key = getkey(ctx).strip()
76 key = getkey(ctx).strip()
84 key = amap.get(key, key) # alias remap
77 key = amap.get(key, key) # alias remap
85 if opts.get(b'changesets'):
78 if opts.get(b'changesets'):
@@ -100,6 +93,7 b' def countrate(ui, repo, amap, *pats, **o'
100 pats=pats,
93 pats=pats,
101 opts=opts,
94 opts=opts,
102 revspec=opts[b'rev'],
95 revspec=opts[b'rev'],
96 date=opts[b'date'],
103 include_pats=opts[b'include'],
97 include_pats=opts[b'include'],
104 exclude_pats=opts[b'exclude'],
98 exclude_pats=opts[b'exclude'],
105 )
99 )
General Comments 0
You need to be logged in to leave comments. Login now