Skip to content
Snippets Groups Projects
  1. Feb 21, 2025
    • Mitchell Kember's avatar
      rust: enable workspace lints · 1ef08a0381a0
      Mitchell Kember authored
      This means that lints configured in rust/Cargo.toml will apply to all crates
      within the workspace. Currently there are none but I plan to add some.
      1ef08a0381a0
  2. Nov 04, 2024
    • Raphaël Gomès's avatar
      rust: remove `atty` dependency · 56e8841a454c
      Raphaël Gomès authored
      It is fully replaced with the now stable `std::io::IsTerminal` trait.
      
      This was the last dependency flagged as a warning by `cargo audit`,
      aside from `cpython` which we know about all too well: the plan is to
      transition to PyO3 soon-ish.
      56e8841a454c
    • Raphaël Gomès's avatar
      rust: update `env_logger` dependency · 492d167aa508
      Raphaël Gomès authored
      Aside from being more up-to-date in general, this makes its own dependency
      on the unmaintained and now useless `atty` disappear.
      492d167aa508
    • Raphaël Gomès's avatar
      rust: update `clap` to the latest 4.x version · f7b2806035a7
      Raphaël Gomès authored
      This brings in more up-to-date dependencies, some bug fixes (none of which are
      relevant yet), and slightly improved compile times.
      f7b2806035a7
  3. Aug 01, 2024
  4. Jun 13, 2023
    • Raphaël Gomès's avatar
      rust-dependencies: switch from `users` to `whoami` · d39ac3468ad4
      Raphaël Gomès authored
      `users` is unmaintained, with the maintainer apparently MIA. `whoami` is a
      popular crate that does simple wrapping of platform-specific calls.
      
      This makes the overhead from using `blackbox` lower. It used to be up 10ms
      on slower hardware for both calls, now down to <1ms which is always good.
      d39ac3468ad4
  5. Mar 06, 2023
  6. Feb 22, 2023
  7. Jan 06, 2023
    • Raphaël Gomès's avatar
      rust: use `logging_timer` instead of `micro_timer` · c15b415d1bff
      Raphaël Gomès authored
      I am the author of `micro_timer`.
      I built it at the time because I couldn't find a crate that was simple to use
      and flexible to do function timing with. Turns out I just couldn't find it
      because crates.io's search isn't all that great, or maybe I didn't look hard
      enough.
      
      `logging_timer` is better in every way:
          - supports changing the logging level
          - supports start and end logging
          - supports intermediary messages
          - supports inline macros
          - supports formatting the output
          - better IDE/tree-sitter integration thanks to a more robust proc macro
      
      I also changed all uses to one-liners, so it's easier to copy-paste.
      c15b415d1bff
  8. Nov 15, 2022
  9. Nov 14, 2022
    • Raphaël Gomès's avatar
      rhg: upgrade `clap` dependency · 37bc3edef76f
      Raphaël Gomès authored
      This one is the worst one to upgrade since v2 -> v4 broke a ton of API,
      which thankfully seems saner now.
      
      Contrary to what was done in the `hg-core/src/examples/nodemap` rewrite,
      we're not switching from the "builder" pattern to the "derive" pattern,
      since that would imply a much larger diff. It can be done incrementally.
      37bc3edef76f
    • Raphaël Gomès's avatar
      rust: move all crates in the main workspace to edition 2021 · 1b6be761c23d
      Raphaël Gomès authored
      We've changed our minimum Rust version to 1.61.0 in the previous patch,
      and edition 2021 predates that version.
      1b6be761c23d
  10. Oct 05, 2022
    • Arseniy Alekseyev's avatar
      rhg: parallellize computation of [unsure_is_modified] · 52464a20add0
      Arseniy Alekseyev authored
      [unsure_is_modified] is called for every file for which we can't
      determine its status based on its size and mtime alone.
      
      In particular, this happens if the mtime of the file changes
      without its contents changing.
      
      Parallellizing this improves performance significantly when
      we have many of these files.
      
      Here's an example run (on a repo with ~400k files after dropping FS caches)
      
      ```
      before:
      real	0m53.901s
      user	0m27.806s
      sys	0m31.325s
      
      after:
      real	0m32.017s
      user	0m34.277s
      sys	1m26.250s
      ```
      
      Another example run (a different FS):
      
      ```
      before:
      real	3m28.479s
      user	0m31.800s
      sys	0m25.324s
      
      after:
      real	0m29.751s
      user	0m41.814s
      sys	1m15.387s
      ```
      52464a20add0
  11. May 04, 2022
  12. Apr 19, 2022
    • Raphaël Gomès's avatar
      rhg: use `Command::exec` instead of `Command::status` · 006688e36e12
      Raphaël Gomès authored
      `rhg` is supposed to be a transparent executable, using a subprocess defeats
      that purpose. See inline comments for more details.
      
      This also introduces the `which` crate to check if the fallback executable
      actually exists to help debugging (plain `execve` doesn't give much
      information).
      
      The error code 253 is used to signify that the fallback is not found, but may
      mean in the future that it is otherwise invalid if we start being more
      specific.
      
      Differential Revision: https://phab.mercurial-scm.org/D12578
      006688e36e12
  13. Mar 09, 2022
    • Raphaël Gomès's avatar
      rhg: upgrade dependencies · 8848c3453661
      Raphaël Gomès authored
      This upgrades all dependencies to their latest version, except `clap`, which
      is upgraded to the last 2.x series version, since 3.x does not support our
      minimum supported Rust version of 1.48.0.
      
      This contains a security fix for `regex` which does not affect us too much, but
      doesn't hurt, and the rest of the upgrades are there simply to keep up.
      
      Differential Revision: https://phab.mercurial-scm.org/D12357
      8848c3453661
  14. Feb 10, 2022
  15. Dec 17, 2021
  16. Apr 10, 2021
    • Pulkit Goyal's avatar
      rhg: read [paths] for `--repository` value · ebdef6283798
      Pulkit Goyal authored
      hg parses `-R` and `--repository` CLI arguments "early" in order to know which
      local repository to load config from. (Config can then affect whether or how to
      fall back.)
      
      The value of of those arguments can be not only a filesystem path, but also an
      alias configured in the `[paths]` section. This part was missing in rhg and
      this patch implements that.
      
      The current patch still lacks functionality to read config of current repository
      if we are not at root of repo. That will be fixed in upcoming patches.
      
      A new crate `home` is added to get path of home directory.
      
      Differential Revision: https://phab.mercurial-scm.org/D10296
      ebdef6283798
  17. Mar 04, 2021
  18. Mar 03, 2021
  19. Feb 16, 2021
  20. Feb 08, 2021
  21. Jan 26, 2021
  22. Nov 26, 2020
  23. Sep 23, 2020
  24. Jul 07, 2020
    • Antoine Cezar's avatar
      rhg: add a limited `rhg root` subcommand · 18f8d3b31baa
      Antoine Cezar authored
      Clap has been choosen for argument parsing for the following reasons:
      
      - it's a wildly used and maintained crate
      - it can deal with OS encoding making it suitable for any encoding
      - it supports nonambiguous prefix matching as already available in hg
      - it will soon allow for structopts-style declarative pattern instead of the
        currently used builder pattern
      
      Differential Revision: https://phab.mercurial-scm.org/D8613
      18f8d3b31baa
  25. Jun 05, 2020
Loading