# HG changeset patch # User Martin von Zweigbergk # Date 1427237277 25200 # Node ID 961790c35b4f130990b33afc94612cbfa2e95484 # Parent bab983bb6fd1117291e61de865a042a17c809a42 revert: take fast path also when not reverting to '.' This speeds up 'hg revert -r .^ --all --dry-run' on the Mozilla repo from 4.081s to 0.826s. Note that 'hg revert -r .^ .' does not get any faster, since '.' does not make match.always() True. I can't think of a reason it would break anything, and if it does, it's clearly not covered by tests. diff -r bab983bb6fd1 -r 961790c35b4f mercurial/cmdutil.py --- a/mercurial/cmdutil.py Tue Mar 24 13:56:51 2015 -0700 +++ b/mercurial/cmdutil.py Tue Mar 24 15:47:57 2015 -0700 @@ -2811,7 +2811,7 @@ wctx = repo[None] m = scmutil.match(wctx, pats, opts) - if not m.always() or node != parent: + if not m.always(): m.bad = lambda x, y: False for abs in repo.walk(m): names[abs] = m.rel(abs), m.exact(abs) @@ -2840,7 +2840,7 @@ changes = repo.status(node1=node, match=m, unknown=True, ignored=True, clean=True) else: - changes = repo.status(match=m) + changes = repo.status(node1=node, match=m) for kind in changes: for abs in kind: names[abs] = m.rel(abs), m.exact(abs)