Skip to content
Snippets Groups Projects
  1. Sep 01, 2019
  2. Sep 15, 2019
  3. Sep 08, 2019
  4. Aug 26, 2019
  5. Sep 01, 2019
  6. Aug 31, 2019
  7. Aug 22, 2019
  8. Aug 28, 2019
  9. Aug 29, 2019
  10. Aug 17, 2019
  11. Aug 16, 2019
  12. Jul 10, 2019
    • Raphaël Gomès's avatar
      rust-dirstate: rust-cpython bridge for dirstatemap · 4e8f5044
      Raphaël Gomès authored
      This change also showcases the limitations of the `py_shared_ref!` macro.
      
      See the previous commit 'rust-dirstate: rust implementation of dirstatemap`
      for an explanation for the TODOs in the code.
      
      Differential Revision: https://phab.mercurial-scm.org/D6633
      4e8f5044
    • Raphaël Gomès's avatar
      rust-dirstate: rust implementation of dirstatemap · fce6dc93
      Raphaël Gomès authored
      The `dirstatemap` is one of the last building blocks needed to get to a
      `dirstate.walk` Rust implementation.
      
      Disclaimer: This change is part of a big (10) series of patches, all of which
      started as one big changeset that took a long time to write.
      This `dirstatemap` implementation is a compromise in terms of complexity both
      for me and for the reviewers. I chose to submit this patch right now because
      while it is not perfect, it works and is simple enough (IMHO) to be reviewed.
      
      The Python implementation uses a lot of lazy propertycaches, breaks
      encapsulation and is used as an iterator in a lot of places, all of which
      dictated the somewhat unidiomatic patterns in this change.
      Like written in the comments, rewriting this struct to use the typestate
      pattern might be a good idea, but this is a good first step.
      
      Differential Revision: https://phab.mercurial-scm.org/D6632
      fce6dc93
  13. Jul 09, 2019
    • Raphaël Gomès's avatar
      rust-cpython: add macro for sharing references · 30320c7b
      Raphaël Gomès authored
      Following an experiment done by Georges Racinet, we now have a working way of
      sharing references between Python and Rust. This is needed in many points of
      the codebase, for example every time we need to expose an iterator to a
      Rust-backed Python class.
      
      In a few words, references are (unsafely) marked as `'static` and coupled
      with manual reference counting; we are doing manual borrow-checking.
      
      This changes introduces two declarative macro to help reduce boilerplate.
      While it is better than not using macros, they are not perfect. They need to:
      
      	- Integrate with the garbage collector for container types (not needed
      	  as of yet), as stated in the docstring
      	- Allow for leaking multiple attributes at the same time
      	- Inject the `py_shared_state` data attribute in `py_class`-generated
      	  structs
      	- Automatically namespace the functions and attributes they generate
      
      For at least the last two points, we will need to write a procedural macro
      instead of a declarative one.
      While this reference-sharing mechanism is being ironed out I thought it best
      not to implement it yet.
      
      Lastly, and implementation detail renders our Rust-backed Python iterators too
      strict to be proper drop-in replacements, as will be illustrated in a future
      patch: if the data structure referenced by a non-depleted iterator is mutated,
      an `AlreadyBorrowed` exception is raised, whereas Python would allow it, only
      to raise a `RuntimeError` if `next` is called on said iterator. This will have
      to be addressed at some point.
      
      Differential Revision: https://phab.mercurial-scm.org/D6631
      30320c7b
    • Raphaël Gomès's avatar
      4b3b27d5
  14. Jul 17, 2019
  15. Jul 09, 2019
Loading