Page MenuHomePhabricator

Alphare (Raphaël Gomès)
User

Projects

User does not belong to any projects.

User Details

User Since
Apr 18 2019, 7:59 AM (13 w, 1 d)

Recent Activity

Yesterday

Alphare committed rHG2f760da140ee: rust-utils: remove buggy assertion.
rust-utils: remove buggy assertion
Thu, Jul 18, 8:49 AM
Alphare committed rHG5672bb73f61e: rust-utils: add docstrings and doctests for utils.rs.
rust-utils: add docstrings and doctests for utils.rs
Thu, Jul 18, 8:49 AM
Alphare committed rHG326fdce22fb2: rust: switch hg-core and hg-cpython to rust 2018 edition.
rust: switch hg-core and hg-cpython to rust 2018 edition
Thu, Jul 18, 8:49 AM
Alphare added a comment to D6597: rust-2018: switch hg-core and hg-cpython to rust 2018 edition.
In D6597#97348, @yuja wrote:

diff --git a/rust/hg-core/src/utils/mod.rs b/rust/hg-core/src/utils/mod.rs
deleted file mode 100644

Can you rename these instead of adding new files? Last time I fixed that
manually, and I don't wanna do that again.

Thu, Jul 18, 5:24 AM

Wed, Jul 17

Alphare closed D6651: rust-utils: remove buggy assertion.
Wed, Jul 17, 7:04 PM
Alphare committed rHGa6a272c4ebf9: rust-utils: remove buggy assertion.
rust-utils: remove buggy assertion
Wed, Jul 17, 7:04 PM
Alphare updated the diff for D6427: discovery: new devel.discovery.randomize option.
Wed, Jul 17, 12:31 PM
Alphare updated the diff for D6426: rust-discovery: optionally don't randomize at all, for tests.
Wed, Jul 17, 12:31 PM
Alphare updated the diff for D6424: rust-discovery: takefullsample() core implementation.
Wed, Jul 17, 12:31 PM
Alphare updated the diff for D6423: rust-discovery: core implementation for take_quick_sample().
Wed, Jul 17, 12:30 PM
Alphare updated the diff for D6425: rust-discovery: exposing sampling to python.
Wed, Jul 17, 12:30 PM
Alphare updated the diff for D6517: rust-discovery: read the index from a repo passed at init.
Wed, Jul 17, 12:30 PM
Alphare updated the diff for D6516: rust-discovery: accept the new 'respectsize' init arg.
Wed, Jul 17, 12:30 PM
Alphare created D6651: rust-utils: remove buggy assertion.
Wed, Jul 17, 12:16 PM
Alphare closed D6597: rust-2018: switch hg-core and hg-cpython to rust 2018 edition.
Wed, Jul 17, 10:26 AM
Alphare closed D6635: rust-utils: add docstrings and doctests for utils.rs.
Wed, Jul 17, 10:25 AM
Alphare committed rHG95113d70e6af: rust-utils: add docstrings and doctests for utils.rs.
rust-utils: add docstrings and doctests for utils.rs
Wed, Jul 17, 10:25 AM
Alphare committed rHG988cf9840866: rust-2018: switch hg-core and hg-cpython to rust 2018 edition.
rust-2018: switch hg-core and hg-cpython to rust 2018 edition
Wed, Jul 17, 10:25 AM
Alphare closed D6639: rust-utils: use new find_dirs iterator.
Wed, Jul 17, 10:24 AM
Alphare committed rHG717686c5e461: rust-utils: use new find_dirs iterator.
rust-utils: use new find_dirs iterator
Wed, Jul 17, 10:24 AM
Alphare added inline comments to D6629: rust-dirstate: use EntryState enum instead of literals.
Wed, Jul 17, 6:29 AM

Tue, Jul 16

Alphare added a comment to D6597: rust-2018: switch hg-core and hg-cpython to rust 2018 edition.

LGTM, but needs rebased (sorry for slow response)

Tue, Jul 16, 2:16 PM

Fri, Jul 12

Alphare updated the diff for D6628: rust-parsers: switch to parse/pack_dirstate to mutate-on-loop.
Fri, Jul 12, 5:24 AM
Alphare updated the diff for D6629: rust-dirstate: use EntryState enum instead of literals.
Fri, Jul 12, 5:24 AM
Alphare updated the diff for D6597: rust-2018: switch hg-core and hg-cpython to rust 2018 edition.
Fri, Jul 12, 5:24 AM
Alphare created D6639: rust-utils: use new find_dirs iterator.
Fri, Jul 12, 5:17 AM
Alphare updated the diff for D6634: rust-dirstate: call rust dirstatemap from Python.
Fri, Jul 12, 4:50 AM
Alphare updated the diff for D6630: rust-docstrings: add missing module docstrings.
Fri, Jul 12, 4:50 AM

Wed, Jul 10

Alphare added a comment to D6625: rust-cargo: reorder dependencies.

Why? Before it was sorted, and now it's not.

Wed, Jul 10, 4:47 PM
Alphare abandoned D6594: [ABANDONED] RFC dirstatemap.
Wed, Jul 10, 4:43 PM
Alphare retitled D6594: [ABANDONED] RFC dirstatemap from RFC dirstatemap to [ABANDONED] RFC dirstatemap.
Wed, Jul 10, 4:40 PM
Alphare added a comment to D6594: [ABANDONED] RFC dirstatemap.

I have updated and split this RFC into a new series (https://phab.mercurial-scm.org/D6625, see the Stack tab).
This differential can be considered outdated.

Wed, Jul 10, 11:46 AM
Alphare created D6635: rust-utils: add docstrings and doctests for utils.rs.
Wed, Jul 10, 11:42 AM
Alphare updated the summary of D6597: rust-2018: switch hg-core and hg-cpython to rust 2018 edition.
Wed, Jul 10, 11:07 AM
Alphare added inline comments to D6597: rust-2018: switch hg-core and hg-cpython to rust 2018 edition.
Wed, Jul 10, 11:06 AM
Alphare added a comment to D6597: rust-2018: switch hg-core and hg-cpython to rust 2018 edition.
In D6597#96317, @pulkit wrote:

Can you add link of mailing list thread in your commit message? Link from markmail or https://www.mercurial-scm.org/pipermail/mercurial-devel/.

Wed, Jul 10, 11:02 AM
Alphare added a comment to D6597: rust-2018: switch hg-core and hg-cpython to rust 2018 edition.

Is the SliceExt change related to the 2018 change? If not could you split the two?

Wed, Jul 10, 11:02 AM
Alphare created D6634: rust-dirstate: call rust dirstatemap from Python.
Wed, Jul 10, 10:35 AM
Alphare created D6633: rust-dirstate: rust-cpython bridge for dirstatemap.
Wed, Jul 10, 10:34 AM
Alphare created D6632: rust-dirstate: rust implementation of dirstatemap.
Wed, Jul 10, 10:34 AM
Alphare created D6631: rust-cpython: add macro for sharing references.
Wed, Jul 10, 7:48 AM
Alphare created D6628: rust-parsers: switch to parse/pack_dirstate to mutate-on-loop.
Wed, Jul 10, 7:48 AM
Alphare created D6629: rust-dirstate: use EntryState enum instead of literals.
Wed, Jul 10, 7:48 AM
Alphare created D6630: rust-docstrings: add missing module docstrings.
Wed, Jul 10, 7:47 AM
Alphare created D6627: rust-parsers: move parser bindings to their own file and Python module.
Wed, Jul 10, 7:47 AM
Alphare created D6626: rust-dirstate: create dirstate submodule in hg-cpython.
Wed, Jul 10, 7:46 AM
Alphare created D6625: rust-cargo: reorder dependencies.
Wed, Jul 10, 7:46 AM

Mon, Jul 8

Alphare updated the diff for D6594: [ABANDONED] RFC dirstatemap.
Mon, Jul 8, 9:55 AM
Alphare added a comment to D6594: [ABANDONED] RFC dirstatemap.

Do you have some benchmark number compared to simpler (and dumb) approaches
such as caching PyList/Dict representation?

Mon, Jul 8, 9:34 AM

Fri, Jul 5

Alphare added a comment to D6593: rust-minor-fixes: remove Deref in favor of explicit methods.
In D6593#96417, @yuja wrote:
Using `keys()` will change the behavior, as I actually need to expose an `Iter<Vec<u8>, u32>`. Is your issue with the naming?

No. My point is that the refcount value is an implementation detail.
Do you have some plan to use the refcount value?

diff --git a/rust/hg-core/src/dirstate/dirs_multiset.rs b/rust/hg-core/src/dirstate/dirs_multiset.rs
--- a/rust/hg-core/src/dirstate/dirs_multiset.rs
+++ b/rust/hg-core/src/dirstate/dirs_multiset.rs
@@ -8,7 +8,7 @@
 //! A multiset of directory names.
 //!
 //! Used to counts the references to directories in a manifest or dirstate.
-use std::collections::hash_map::{Entry, Iter};
+use std::collections::hash_map::{Entry, Keys};
 use std::collections::HashMap;
 use {DirsIterable, DirstateEntry, DirstateMapError};
@@ -128,8 +128,8 @@ impl DirsMultiset {
         self.inner.contains_key(key)
     }
-    pub fn iter(&self) -> Iter<Vec<u8>, u32> {
-        self.inner.iter()
+    pub fn iter(&self) -> Keys<Vec<u8>, u32> {
+        self.inner.keys()
     }
     pub fn len(&self) -> usize {
diff --git a/rust/hg-cpython/src/dirstate.rs b/rust/hg-cpython/src/dirstate.rs
--- a/rust/hg-cpython/src/dirstate.rs
+++ b/rust/hg-cpython/src/dirstate.rs
@@ -271,20 +271,9 @@ py_class!(pub class Dirs |py| {
     // of having it work to continue working on the rest of the module
     // hopefully bypassing Python entirely pretty soon.
     def __iter__(&self) -> PyResult<PyObject> {
-        let dict = PyDict::new(py);
-
-        for (key, value) in self.dirs_map(py).borrow().iter() {
-            dict.set_item(
-                py,
-                PyBytes::new(py, &key[..]),
-                value.to_py_object(py),
-            )?;
-        }
-
-        let locals = PyDict::new(py);
-        locals.set_item(py, "obj", dict)?;
-
-        py.eval("iter(obj)", None, Some(&locals))
+        // maybe there would be a better way to cast objects back and forth?
+        let dirs: Vec<_> = self.dirs_map(py).borrow().iter().map(|d| PyBytes::new(py, d)).collect();
+        dirs.to_py_object(py).into_object().iter(py).map(|o| o.into_object())
     }
     def __contains__(&self, item: PyObject) -> PyResult<bool> {
Fri, Jul 5, 10:29 AM
Alphare added a comment to D6593: rust-minor-fixes: remove Deref in favor of explicit methods.

Again,

  • contains() -> inner.contains_key()
  • iter() -> inner.keys()

Somewhat similar to HashSet, which is basically a proxy type to
HashMap<T, ()>.

Fri, Jul 5, 9:13 AM
Alphare closed D6591: rust-minor-fixes: run rfmt on all hg-core/hg-cpython code.
Fri, Jul 5, 8:52 AM
Alphare closed D6593: rust-minor-fixes: remove Deref in favor of explicit methods.
Fri, Jul 5, 8:52 AM
Alphare closed D6592: rust-minor-fixes: simplify overly complicated expression.
Fri, Jul 5, 8:52 AM
Alphare committed rHGa80464e85ddd: rust: remove Deref in favor of explicit methods.
rust: remove Deref in favor of explicit methods
Fri, Jul 5, 8:51 AM
Alphare committed rHG11c025c83393: rust: simplify overly complicated expression.
rust: simplify overly complicated expression
Fri, Jul 5, 8:51 AM
Alphare committed rHGd26e4a434fe5: rust: run rfmt on all hg-core/hg-cpython code.
rust: run rfmt on all hg-core/hg-cpython code
Fri, Jul 5, 8:51 AM
Alphare updated the diff for D6593: rust-minor-fixes: remove Deref in favor of explicit methods.
Fri, Jul 5, 4:35 AM

Thu, Jul 4

Alphare created D6597: rust-2018: switch hg-core and hg-cpython to rust 2018 edition.
Thu, Jul 4, 10:58 AM
Alphare updated the diff for D6593: rust-minor-fixes: remove Deref in favor of explicit methods.
Thu, Jul 4, 10:53 AM
Alphare created D6594: [ABANDONED] RFC dirstatemap.
Thu, Jul 4, 10:53 AM
Alphare added a comment to D6594: [ABANDONED] RFC dirstatemap.

If that helps, I just wrote an article on sharing references between Rust and Python: https://raphaelgomes.dev/blog/articles/2019-07-01-sharing-references-between-python-and-rust.html.

Thu, Jul 4, 10:51 AM
Alphare created D6591: rust-minor-fixes: run rfmt on all hg-core/hg-cpython code.
Thu, Jul 4, 10:49 AM
Alphare created D6593: rust-minor-fixes: remove Deref in favor of explicit methods.
Thu, Jul 4, 10:48 AM
Alphare created D6592: rust-minor-fixes: simplify overly complicated expression.
Thu, Jul 4, 10:48 AM
Alphare added a comment to D6394: rust-dirstate: add "dirs" rust-cpython binding.
In D6394#96189, @yuja wrote:
To my eyes, the point of `Deref` is to make the `struct` act as a "fat pointer" from the outer interface code, but maybe this does not really help that much?

I feel DirsMultiset isn't a HashMap, but is implemented by using a HashMap.
For example, inner.get().unwrap() returns a refcount of the path, but which
is an implementation detail.
So I think it's better to define methods explicitly instead of proxying
everything to HashMap.

Thu, Jul 4, 10:48 AM

Mon, Jul 1

Alphare added a comment to D6394: rust-dirstate: add "dirs" rust-cpython binding.
In D6394#96115, @yuja wrote:

+ def contains(&self, item: PyObject) -> PyResult<bool> {
+ Ok(self
+ .dirs_map(py)
+ .borrow()
+ .get(&item.extract::<PyBytes>(py)?.data(py).to_owned())
+ .is_some())

.contains_key(..) and .as_ref() instead of &...to_owned().
I'm surprised by the use of Deref in the previous patch. Is it legit
to leverage Deref to expose the inner type?

Mon, Jul 1, 4:46 AM

Sun, Jun 30

Alphare committed rHG2db96bf84a8f: rust-dirstate: call new "dirs" rust implementation from Python.
rust-dirstate: call new "dirs" rust implementation from Python
Sun, Jun 30, 12:14 AM

Fri, Jun 28

Alphare closed D6395: rust-dirstate: call new "dirs" rust implementation from Python.
Fri, Jun 28, 11:14 AM
Alphare closed D6393: rust-dirstate: add "dirs" Rust implementation.
Fri, Jun 28, 11:14 AM
Alphare closed D6394: rust-dirstate: add "dirs" rust-cpython binding.
Fri, Jun 28, 11:14 AM
Alphare committed rHGf5ef8c85477d: rust-dirstate: call new "dirs" rust implementation from Python.
rust-dirstate: call new "dirs" rust implementation from Python
Fri, Jun 28, 11:14 AM
Alphare committed rHGce94f9622acd: rust-dirstate: add "dirs" rust-cpython binding.
rust-dirstate: add "dirs" rust-cpython binding
Fri, Jun 28, 11:14 AM
Alphare committed rHG2dcee6497b0b: rust-dirstate: add "dirs" Rust implementation.
rust-dirstate: add "dirs" Rust implementation
Fri, Jun 28, 11:14 AM

Thu, Jun 27

Alphare updated the diff for D6395: rust-dirstate: call new "dirs" rust implementation from Python.
Thu, Jun 27, 9:17 AM
Alphare added a comment to D6393: rust-dirstate: add "dirs" Rust implementation.

Sorry. I was busy. In general don't worry about blocking on me, I can't promise any sort of reasonable response time. Worst case I can review the changes after submission and changes can be made afterwards.

Thu, Jun 27, 9:17 AM
Alphare updated the diff for D6393: rust-dirstate: add "dirs" Rust implementation.
Thu, Jun 27, 9:17 AM
Alphare updated the diff for D6394: rust-dirstate: add "dirs" rust-cpython binding.
Thu, Jun 27, 9:17 AM

Jun 17 2019

Alphare added inline comments to D6394: rust-dirstate: add "dirs" rust-cpython binding.
Jun 17 2019, 11:36 AM
Alphare added a comment to D6393: rust-dirstate: add "dirs" Rust implementation.

@kevincox, do you have any comments about this change?

Jun 17 2019, 11:29 AM

Jun 14 2019

Alphare added a comment to D6395: rust-dirstate: call new "dirs" rust implementation from Python.

Updated to use the new Rust module policy

Jun 14 2019, 6:15 AM
Alphare updated the diff for D6395: rust-dirstate: call new "dirs" rust implementation from Python.
Jun 14 2019, 6:14 AM
Alphare updated the diff for D6393: rust-dirstate: add "dirs" Rust implementation.
Jun 14 2019, 6:14 AM

Jun 10 2019

Alphare committed rHG48f1f864d928: rust-regex: fix shortcut for exact matches.
rust-regex: fix shortcut for exact matches
Jun 10 2019, 10:57 AM
Alphare closed D6489: rust-regex: fix shortcut for exact matches.
Jun 10 2019, 10:57 AM
Alphare committed rHG9609430d3625: rust-filepatterns: use bytes instead of String.
rust-filepatterns: use bytes instead of String
Jun 10 2019, 10:57 AM
Alphare closed D6485: rust-filepatterns: use bytes instead of String.
Jun 10 2019, 10:57 AM

Jun 8 2019

Alphare added a comment to D6496: phabricator: add commenting to phabsend for new/updated Diffs.

@Kwan Very useful, thanks!

Jun 8 2019, 6:57 AM

Jun 7 2019

Alphare created D6489: rust-regex: fix shortcut for exact matches.
Jun 7 2019, 5:50 AM

Jun 6 2019

Alphare committed rHGd3b5cbe311d9: rust-dirstate: create dirstate submodule.
rust-dirstate: create dirstate submodule
Jun 6 2019, 7:26 PM
Alphare closed D6389: rust-dirstate: create dirstate submodule.
Jun 6 2019, 11:41 AM
Alphare committed rHGcc1cdce1eea2: rust-dirstate: create dirstate submodule.
rust-dirstate: create dirstate submodule
Jun 6 2019, 11:40 AM
Alphare created D6485: rust-filepatterns: use bytes instead of String.
Jun 6 2019, 11:24 AM
Alphare added a comment to D6389: rust-dirstate: create dirstate submodule.

@kevincox I've rebase my changes as well as the next series (D6393, D6394, D6395).

Jun 6 2019, 4:48 AM

Jun 5 2019

Alphare updated the diff for D6393: rust-dirstate: add "dirs" Rust implementation.
Jun 5 2019, 3:05 PM
Alphare updated the diff for D6395: rust-dirstate: call new "dirs" rust implementation from Python.
Jun 5 2019, 3:04 PM
Alphare updated the diff for D6394: rust-dirstate: add "dirs" rust-cpython binding.
Jun 5 2019, 3:04 PM
Alphare added a comment to D6393: rust-dirstate: add "dirs" Rust implementation.

Does this need updating after D6403? Based on a cursory look at the patch, it has not been updated yet.

Jun 5 2019, 3:04 PM

May 24 2019

Alphare added inline comments to D6389: rust-dirstate: create dirstate submodule.
May 24 2019, 6:04 AM
Alphare added inline comments to D6389: rust-dirstate: create dirstate submodule.
May 24 2019, 5:34 AM