Pulkit Goyal <7895pulkit@gmail.com> [Sat, 29 Feb 2020 12:58:13 +0530] rev 44544
scmutil: add option to register summary callbacks as transaction validators
We have a list of summary callbacks which are run after the transaction is
closed to show what has changed and what not. This patch makes it possible to
register those callbacks as transaction validators so that we can show summary
before committing the transaction and prompt user to accept the changes.
The goal of this is to implement `pull --confirm`.
Differential Revision: https://phab.mercurial-scm.org/D8199
Pulkit Goyal <7895pulkit@gmail.com> [Sat, 29 Feb 2020 12:56:37 +0530] rev 44543
transaction: add functionality to have multiple validators
This will help us in adding more validators which can aggregate data from
transaction and prompt user whether to commit the transaction or not.
The current target is to use this to implement `pull --confirm`.
Differential Revision: https://phab.mercurial-scm.org/D8198
Pulkit Goyal <7895pulkit@gmail.com> [Wed, 04 Mar 2020 22:13:15 +0530] rev 44542
hgit: make sure repository is local before checking for store type
httppeer (and maybe others too) does not have a store attribute. This was
causing `hg pull` being broken on a hg repository when the extension is enabled.
localpeer.local() does returns a non-None value but I am not sure if it matters.
Differential Revision: https://phab.mercurial-scm.org/D8217
Raphaël Gomès <rgomes@octobus.net> [Fri, 06 Mar 2020 18:08:23 +0100] rev 44541
hg-core: add function timing information
This change makes use of the newly added logging infrastructure to trace the
execution time of some important calls.
This approach is very much complementary to using a profiler and will not
guard against out-of-order execution or other kinds of compiler optimizations.
That said, it is useful to get a rough high-level idea of where time is spent.
Differential Revision: https://phab.mercurial-scm.org/D8253
Raphaël Gomès <rgomes@octobus.net> [Fri, 06 Mar 2020 18:08:13 +0100] rev 44540
rust: add logging utils
This change adds the `log` crate, the community-approved logging facade backed
by Rust core developers as well as the logging-consumer crate `simple_logger`
to build a foundation for logging from Rust.
Using this setup allows us to choose how to log depending on the way `hg-core`
is used: if it's within the context of `hg-cpython`, we might not want to use
it the same way as with a direct cli for example.
Differential Revision: https://phab.mercurial-scm.org/D8252
Raphaël Gomès <rgomes@octobus.net> [Fri, 06 Mar 2020 17:51:24 +0100] rev 44539
rust-status: traverse working directory in parallel
Using `rayon` for this task ensures that we are using the same work-stealing
threadpool for everything.
This change introduces `crossbeam` as an explicit dependency, although it is
already a dependency of `rayon`. It provides better structures for
multi-threaded tasks than the stdlib.
Differential Revision: https://phab.mercurial-scm.org/D8251
Raphaël Gomès <rgomes@octobus.net> [Fri, 06 Mar 2020 17:51:03 +0100] rev 44538
rust-status: wrap `stat_dmap_entries` to ease profiling
Differential Revision: https://phab.mercurial-scm.org/D8250
Raphaël Gomès <rgomes@octobus.net> [Fri, 06 Mar 2020 17:48:30 +0100] rev 44537
rust-status: refactor handling of unknown files
Differential Revision: https://phab.mercurial-scm.org/D8249
Raphaël Gomès <rgomes@octobus.net> [Wed, 19 Feb 2020 11:14:30 +0100] rev 44536
rust-status: move to recursive traversal to prepare for parallel traversal
I have looked into traversing the working directory in parallel either
by a recursive or an iterative algorithm. The recursive approach won quite
decisively both in terms of performance and code readability.
You can look at my experiment here:
https://heptapod.octobus.net/Alphare/rayon-recursive-traversal
The chance of a stack overflow happening because the directories get too nested
seems slim.
This change does not yet do anything in parallel.
Differential Revision: https://phab.mercurial-scm.org/D8215
Raphaël Gomès <rgomes@octobus.net> [Wed, 04 Mar 2020 15:10:11 +0100] rev 44535
rust-pathauditor: use interior mutability for use in multi-threaded contexts
The usual recommendation for using `RwLock` or `Mutex` is that if there are
about as many write as there are reads, use `Mutex`, and if there are more
reads than writes, use `RwLock`.
If after the main bottleneck (i.e. parallel traversal) is removed this shows
up on profiles, we should investigate using the `parking_lot` since we don't
need a poisoning API, or maybe move to different types of caches entirely.
Differential Revision: https://phab.mercurial-scm.org/D8213
Raphaël Gomès <rgomes@octobus.net> [Wed, 04 Mar 2020 15:12:08 +0100] rev 44534
rust-pathauditor: actually populate the `audited_dirs` cache
I forgot this when rewriting this logic during the review process.
Differential Revision: https://phab.mercurial-scm.org/D8212
Raphaël Gomès <rgomes@octobus.net> [Wed, 04 Mar 2020 15:10:03 +0100] rev 44533
rust-pathauditor: actually split Windows shortname aliases at `~`
Right now, splitting with a max of 1 parts is useless.
Differential Revision: https://phab.mercurial-scm.org/D8211
Raphaël Gomès <rgomes@octobus.net> [Thu, 05 Mar 2020 10:24:45 +0100] rev 44532
debuginstall: add entry about re2 Rust bindings when applicable
Differential Revision: https://phab.mercurial-scm.org/D8226
Raphaël Gomès <rgomes@octobus.net> [Thu, 05 Mar 2020 10:24:10 +0100] rev 44531
rust-cpython: add `debug` module to expose debug information to Python
This will be mostly used in `debuginstall`.
Differential Revision: https://phab.mercurial-scm.org/D8225