1. 15 Jan, 2020 1 commit
  2. 14 Jan, 2020 1 commit
  3. 08 Jan, 2020 1 commit
  4. 07 Dec, 2019 2 commits
  5. 14 Jan, 2020 1 commit
    • revlog-native: introduced ABI version in capsule · f5d2720f3be
      Concerns that an inconsistency could arise between the actual contents
      of the capsule in revlog.c and the Rust consumer have been raised after
      the switch to the array of data and function pointers in f384d68d8ea8.
      
      It has been suggested that the `version` from parsers.c could be use for
      this. In this change, we introduce instead a separate ABI version number,
      which should have the following advantages:
      
      - no need to change the consuming Rust code for changes that have nothing
        to do with the contents of the capsule
      - the version number in parsers.c is not explicitely flagged as ABI. It's
        not obvious to me whether an ABI change that would be invisible to Python
        would warrant an increment
      
      The drawback is that developers now have to consider two version numbers.
      
      We expect the added cost of the check to be negligible because it occurs
      at instantiation of `CIndex` only, which in turn is tied to instantiation
      of Python objects such as `LazyAncestors` and `MixedIndex`. Frequent calls
      to `Cindex::new` should also probably hit the CPU branch predictor.
      
      Differential Revision: https://phab.mercurial-scm.org/D7856
      Georges Racinet authored
  6. 23 Dec, 2019 1 commit
  7. 12 Dec, 2019 2 commits
  8. 13 Dec, 2019 1 commit
  9. 25 Dec, 2019 3 commits
  10. 23 Dec, 2019 1 commit
    • rust-index: add a struct wrapping the C index · b69d5f3a41d
      Implementing the full index logic in one go is journey larger than we would
      like.
      
      To achieve a smoother transition, we start with a simple Rust wrapper that delegates
      allwork to the current C implementation. Once we will have a fully working index
      object in Rust, we can easily start using more and more Rust Code with it.
      
      The object in this patch is functional and tested. However, multiple of the
      currently existing rust (in the `hg-cpython` crate) requires a `Graph`. Right
      now we build this `Graph` (as cindex::Index) using the C index passed as
      a PyObject. They will have to be updated to be made compatible.
      
      Differential Revision: https://phab.mercurial-scm.org/D7655
      Georges Racinet authored
  11. 12 Dec, 2019 1 commit
  12. 27 Nov, 2019 1 commit
    • revlog: made C Capsule an array of function pointers · f384d68d8ea
      Although it's perfectly valid to put a function pointer in
      a capsule, as we've been doing since the start of rust/hg-cpython,
      an array of function pointers has several advantages:
      
      - it can hold several functions. That's our main motivation here.
        We plan to expose index_length() and index_node(), which will
        be needed for a Rust implementation of nodemap.
      - it could also have data
      - (probably minor in the case of Mercurial) proper support for
        architectures for which data and code pointers don't have the
        same size.
      
      Differential Revision: https://phab.mercurial-scm.org/D7543
      Georges Racinet authored
  13. 13 Dec, 2019 1 commit
  14. 29 Nov, 2019 3 commits
  15. 11 Dec, 2019 1 commit
  16. 16 Dec, 2019 1 commit
  17. 12 Dec, 2019 1 commit
    • rust-dirs: handle forgotten `Result`s · bc7d8f45c3b
      In 1fe2e574616e I introduced a temporary bugfix to align Rust code with a new
      behavior from C/Python and forgot about a few `Result`s (cargo's compiler cache
      does not re-emit warnings on cached modules). This fixes it.
      
      For the record, I am still unsure that this behavior change is a good idea.
      
      Note: I was already quite unhappy with the setters and getters for the
      `DirstateMap` and, indirectly, `Dirs`, and this only further reinforces my
      feelings. I hope we can one day fix that situation at the type level; Georges
      Racinet and I were just talking about devising a POC for using the builder
      pattern in the context of FFI with Python, we'll see what comes out of it.
      
      Differential Revision: https://phab.mercurial-scm.org/D7609
      Raphaël Gomès authored
  18. 29 Nov, 2019 5 commits
  19. 19 Nov, 2019 2 commits
  20. 18 Nov, 2019 1 commit
  21. 14 Oct, 2019 1 commit
    • rust-performance: introduce FastHashMap type alias for HashMap · 5ac243a92e3
      Rust's default hashing is slow, because it is meant for preventing collision
      attacks.
      For all of the current Rust code, we don't care about those attacks, because
      if an person with bad intentions has write access to your repo, you have other
      issues.
      
      I've chosen to use the TwoXHash crate because it was made by a reputable member
      of the Rust community and has very good benchmarks.
      
      For now it does not seem to improve performance by much for the current code,
      but it's something else to not worry about when benchmarking code: in a
      previous experiment with copytracing in Rust, it accounted for more than 10%
      of the time of the entire script.
      
      Differential Revision: https://phab.mercurial-scm.org/D7116
      Raphaël Gomès authored
  22. 07 Dec, 2019 1 commit
  23. 14 Oct, 2019 1 commit
  24. 05 Oct, 2019 1 commit
  25. 22 Nov, 2019 1 commit
  26. 19 Nov, 2019 2 commits
  27. 18 Nov, 2019 1 commit
  28. 14 Nov, 2019 1 commit