HomePhabricator

cmdutil: reimplement finddate() without using walkchangerevs()

Authored by yuja.

Description

cmdutil: reimplement finddate() without using walkchangerevs()

It's simpler and slightly faster maybe because a fewer Python ops would
run.

Unscientific benchmark:

$ python -m timeit \
  -s 'from mercurial import hg, ui, cmdutil; repo = hg.repository(ui.ui())' \
  'cmdutil.finddate(repo.ui, repo, "<2008-01-01")'
(orig) 10 loops, best of 3: 1.45 sec per loop
(new)  10 loops, best of 3: 1.25 sec per loop

Now "hg churn" and "hg grep" are the only users of walkchangerevs(), which
I want to refactor and fix bugs.

Details

Committed
yujaSun, Sep 13, 4:52 AM
Parents
rHG65960fe9a769: test-simple-update: add test for -d DATE option
Branches
Unknown
Tags
Unknown