Mercurial > hg
view tests/test-debugrename.t @ 44838:c802ec4f7196
rust-status: collect traversed directories if required
Some commands (`hg purge` notably) register the `traversedir` callback on their
matcher to run said callback every time a directory is traversed.
This is the first of three patches, further broadening Rust support for status.
Unfortunately, there is no way around collecting a full `Vec` (or any other
owned datastructure, like a radix tree) and pushing it back up the Python layer
since keeping the Python callback in a closure would mean giving up
multithreading because of the GIL, which is obviously unacceptable.
Performance is still a lot better than the Python+C path.
Running `hg clean/purge` on Netbeans' repo (100k files):
```
| No-op | 30% unknown
--------------------------
Rust | 1.0s | 1.67s
C | 2.0s | 2.87s
```
Differential Revision: https://phab.mercurial-scm.org/D8518
author | Raphaël Gomès <rgomes@octobus.net> |
---|---|
date | Tue, 12 May 2020 11:36:52 +0200 |
parents | 5d9bc49b0b1e |
children | 55c6ebd11cb9 |
line wrap: on
line source
$ hg init $ echo a > a $ hg ci -Am t adding a $ hg mv a b $ hg ci -Am t1 $ hg debugrename b b renamed from a:b789fdd96dc2f3bd229c1dd8eedf0fc60e2b68e3 $ hg mv b a $ hg ci -Am t2 $ hg debugrename a a renamed from b:37d9b5d994eab34eda9c16b195ace52c7b129980 $ hg debugrename --rev 1 b b renamed from a:b789fdd96dc2f3bd229c1dd8eedf0fc60e2b68e3