Mercurial > hg
view tests/test-empty-dir.t @ 22573:f528bfb25b45
revert: special case 'hg revert --all'
On large repos, hg revert --all can take over 13 seconds. This is mainly due to
it walking the tree three times: once to find the list of files in the
dirstate, once to find the list of files in the target, and once to compute the
status from the dirstate to the target.
This optimizes the hg revert --all case to only require the final status. This
speeds it up to 1.3 seconds or so (with hgwatchman enabled).
Further optimizations could be done for the -r NODE and pattern cases, but they
are significantly more complex.
author | Durham Goode <durham@fb.com> |
---|---|
date | Fri, 19 Sep 2014 18:43:53 -0700 |
parents | 3b165c127690 |
children |
line wrap: on
line source
$ hg init $ echo 123 > a $ hg add a $ hg commit -m "first" a $ mkdir sub $ echo 321 > sub/b $ hg add sub/b $ hg commit -m "second" sub/b $ cat sub/b 321 $ hg co 0 0 files updated, 0 files merged, 1 files removed, 0 files unresolved $ cat sub/b 2>/dev/null || echo "sub/b not present" sub/b not present $ test -d sub || echo "sub not present" sub not present