D7310: rust-threads: force Rayon to respect the worker count in config

2019-11-08 Thread Raphaël Gomès
Closed by commit rHG57384e8e1fb6: rust-threads: force Rayon to respect the worker count in config (authored by Alphare). This revision was automatically updated to reflect the committed changes. This revision was not accepted when it landed; it landed in state "Needs Review". REPOSITORY rHG Me

D7311: utils: move the `dirs` definition in a dedicated module (API)

2019-11-08 Thread Raphaël Gomès
Alphare added inline comments. INLINE COMMENTS > match.py:632 > > # This is basically a reimplementation of util.dirs that stores the children > # instead of just a count of them, plus a small optional optimization to > avoid Should be `dirstateutil.dirs` REPOSITORY rHG Mercurial CHANGE

D7311: utils: move the `dirs` definition in a dedicated module (API)

2019-11-08 Thread Raphaël Gomès
Alphare added a comment. Note that there is a comment in `match.py` about `util.dirs`. It's not that important, but it should be updated. REPOSITORY rHG Mercurial CHANGES SINCE LAST ACTION https://phab.mercurial-scm.org/D7311/new/ REVISION DETAIL https://phab.mercurial-scm.org/D7311

D7310: rust-threads: force Rayon to respect the worker count in config

2019-11-08 Thread Raphaël Gomès
Alphare updated this revision to Diff 17749. REPOSITORY rHG Mercurial CHANGES SINCE LAST UPDATE https://phab.mercurial-scm.org/D7310?vs=17726&id=17749 BRANCH default CHANGES SINCE LAST ACTION https://phab.mercurial-scm.org/D7310/new/ REVISION DETAIL https://phab.mercurial-scm.org/D73

D7310: rust-threads: force Rayon to respect the worker count in config

2019-11-08 Thread Raphaël Gomès
Alphare added a comment. You're right, it shouldn't REPOSITORY rHG Mercurial CHANGES SINCE LAST ACTION https://phab.mercurial-scm.org/D7310/new/ REVISION DETAIL https://phab.mercurial-scm.org/D7310 To: Alphare, #hg-reviewers, martinvonz Cc: martinvonz, mercurial-devel

D7301: rust: introduce SIZE_FROM_OTHER_PARENT constant

2019-11-08 Thread Raphaël Gomès
Alphare updated this revision to Diff 17742. REPOSITORY rHG Mercurial CHANGES SINCE LAST UPDATE https://phab.mercurial-scm.org/D7301?vs=17714&id=17742 BRANCH default CHANGES SINCE LAST ACTION https://phab.mercurial-scm.org/D7301/new/ REVISION DETAIL https://phab.mercurial-scm.org/D73

D7300: rust-status: refactor dispatch case for normal files

2019-11-08 Thread Raphaël Gomès
Alphare updated this revision to Diff 17741. REPOSITORY rHG Mercurial CHANGES SINCE LAST UPDATE https://phab.mercurial-scm.org/D7300?vs=17713&id=17741 BRANCH default CHANGES SINCE LAST ACTION https://phab.mercurial-scm.org/D7300/new/ REVISION DETAIL https://phab.mercurial-scm.org/D73

D7299: rust-status: return a ParallelIterator instead of a Vec from stat_dmap_entries

2019-11-08 Thread Raphaël Gomès
Alphare updated this revision to Diff 17740. REPOSITORY rHG Mercurial CHANGES SINCE LAST UPDATE https://phab.mercurial-scm.org/D7299?vs=17712&id=17740 BRANCH default CHANGES SINCE LAST ACTION https://phab.mercurial-scm.org/D7299/new/ REVISION DETAIL https://phab.mercurial-scm.org/D72

D7254: rust-status: improve status performance

2019-11-08 Thread Raphaël Gomès
Alphare updated this revision to Diff 17739. REPOSITORY rHG Mercurial CHANGES SINCE LAST UPDATE https://phab.mercurial-scm.org/D7254?vs=17711&id=17739 BRANCH default CHANGES SINCE LAST ACTION https://phab.mercurial-scm.org/D7254/new/ REVISION DETAIL https://phab.mercurial-scm.org/D72

D7310: rust-threads: force Rayon to respect the worker count in config

2019-11-08 Thread Raphaël Gomès
Alphare created this revision. Herald added a subscriber: mercurial-devel. Herald added a reviewer: hg-reviewers. REVISION SUMMARY As per the inline comment, this is a workaround because Rust code does not yet know how to read config files. REPOSITORY rHG Mercurial BRANCH default REVISI

D7304: formatting: remove another data-ogre from the config example

2019-11-08 Thread Raphaël Gomès
Alphare added a comment. Thanks, I was going to get bitten by this! REPOSITORY rHG Mercurial CHANGES SINCE LAST ACTION https://phab.mercurial-scm.org/D7304/new/ REVISION DETAIL https://phab.mercurial-scm.org/D7304 To: martinvonz, #hg-reviewers Cc: Alphare, mercurial-devel

D7116: rust-performance: introduce FastHashMap type alias for HashMap

2019-11-08 Thread Raphaël Gomès
Alphare added a comment. I'll rebase this series once my other patches land, to make it easier to get all instances of `HashMap` in the codebase. REPOSITORY rHG Mercurial CHANGES SINCE LAST ACTION https://phab.mercurial-scm.org/D7116/new/ REVISION DETAIL https://phab.mercurial-scm.org

Re: Making Rust respect worker count in config

2019-11-07 Thread Raphaël Gomès
9 5:08 PM, Martin von Zweigbergk via Mercurial-devel wrote: Seems fine to do that every time we read configs in Python. It won't always be correct if there are multiple values for it in different config files (e.g. repo-specific vs user's config). Probably good enough. On Thu, Nov 7, 2

Making Rust respect worker count in config

2019-11-07 Thread Raphaël Gomès
I'd like to make Rust respect to max worker count in config, since it now runs parallel code. Right now, it uses every CPU available, be it logical or physical. I think the simplest way to do so, since Rust does not yet know how to read the config file, is to set the RAYON_NUM_THREADS environm

D7254: rust-status: improve status performance

2019-11-07 Thread Raphaël Gomès
Alphare added a comment. Alphare marked 7 inline comments as done. Thanks for the review @kevincox. INLINE COMMENTS > kevincox wrote in status.rs:64 > I would create a helper function. > > fn mod_compare(a: i32, b: impl Into) -> bool { > let b = b.into(); > a != b && a != b & rang

D7301: rust: introduce SIZE_FROM_OTHER_PARENT constant

2019-11-07 Thread Raphaël Gomès
Alphare created this revision. Herald added subscribers: mercurial-devel, kevincox, durin42. Herald added a reviewer: hg-reviewers. REVISION SUMMARY This will clarify what `-2` meant in the codebase. This change also merged imports in affected files for cleanup. REPOSITORY rHG Mercurial BR

D7253: rust-status: remove dead code

2019-11-07 Thread Raphaël Gomès
Alphare updated this revision to Diff 17710. REPOSITORY rHG Mercurial CHANGES SINCE LAST UPDATE https://phab.mercurial-scm.org/D7253?vs=17628&id=17710 BRANCH default CHANGES SINCE LAST ACTION https://phab.mercurial-scm.org/D7253/new/ REVISION DETAIL https://phab.mercurial-scm.org/D72

D7300: rust-status: refactor dispatch case for normal files

2019-11-07 Thread Raphaël Gomès
Alphare created this revision. Herald added subscribers: mercurial-devel, kevincox, durin42. Herald added a reviewer: hg-reviewers. REVISION SUMMARY This should make the code easier to read and more idiomatic. REPOSITORY rHG Mercurial BRANCH default REVISION DETAIL https://phab.mercuria

D7299: rust-status: return a ParallelIterator instead of a Vec from stat_dmap_entries

2019-11-07 Thread Raphaël Gomès
Alphare created this revision. Herald added subscribers: mercurial-devel, kevincox, durin42. Herald added a reviewer: hg-reviewers. REVISION SUMMARY This allows the caller function to choose when and how the iteration and/or collection happens. This change also cleans up the now unused `filter

D7254: rust-status: improve status performance

2019-11-07 Thread Raphaël Gomès
Alphare updated this revision to Diff 17711. REPOSITORY rHG Mercurial CHANGES SINCE LAST UPDATE https://phab.mercurial-scm.org/D7254?vs=17622&id=17711 BRANCH default CHANGES SINCE LAST ACTION https://phab.mercurial-scm.org/D7254/new/ REVISION DETAIL https://phab.mercurial-scm.org/D72

Re: D7258: makefile: use python3 by default (BC)

2019-11-06 Thread Raphaël Gomès
I think it's a good idea to try to rip the band-aid sooner than later. +1 for what Martin said about Linux tests, it would make sense to know where we're starting to not have the test suite break on our series for Python3 reasons. On 11/6/19 7:43 PM, indygreg (Gregory Szorc) wrote: indygreg

D7253: rust-status: remove dead code

2019-11-06 Thread Raphaël Gomès
Closed by commit rHGab9b0a20b9e6: rust-status: remove dead code (authored by Alphare). This revision was automatically updated to reflect the committed changes. This revision was not accepted when it landed; it landed in state "Needs Review". REPOSITORY rHG Mercurial CHANGES SINCE LAST UPDATE

D7255: rust-matchers: remove default implementations for `Matcher` trait

2019-11-06 Thread Raphaël Gomès
Herald added subscribers: kevincox, durin42. Alphare updated this revision to Diff 17626. REPOSITORY rHG Mercurial CHANGES SINCE LAST UPDATE https://phab.mercurial-scm.org/D7255?vs=17623&id=17626 BRANCH default CHANGES SINCE LAST ACTION https://phab.mercurial-scm.org/D7255/new/ REVISIO

D7255: rust-matchers: remove default implementations for `Matcher` trait

2019-11-06 Thread Raphaël Gomès
Alphare added a comment. `phabsend` failed with the following: ** Unknown exception encountered with possibly-broken third-party extension perf ** which supports versions unknown of Mercurial. ** Please disable perf and try your action again. ** If that fixes the bug please

D7255: rust-matchers: remove default implementations for `Matcher` trait

2019-11-06 Thread Raphaël Gomès
Alphare created this revision. Herald added a subscriber: mercurial-devel. Herald added a reviewer: hg-reviewers. REVISION SUMMARY We don't expect a whole lot of matchers to be defined, and this makes it more obvious what a matcher does by reading its `impl Matcher for FooMatcher`. This p

D7253: rust-status: remove dead code

2019-11-06 Thread Raphaël Gomès
Alphare created this revision. Herald added subscribers: mercurial-devel, kevincox, durin42. Herald added a reviewer: hg-reviewers. REVISION SUMMARY The `walk_explicit` function is only called when using a prefix matcher, which the Rust code does not yet support. This function will return in a

D7254: rust-status: improve status performance

2019-11-06 Thread Raphaël Gomès
Alphare created this revision. Herald added subscribers: mercurial-devel, kevincox, durin42. Herald added a reviewer: hg-reviewers. REVISION SUMMARY This change does more things in the parallel loop, refactors the file-level logic into two functions for added clarity. This bit of Rust cod

D7178: [RFC] rust-matchers: add `Matcher` trait and implement `AlwaysMatcher`

2019-11-05 Thread Raphaël Gomès
rc/matchers.rs CHANGE DETAILS diff --git a/rust/hg-core/src/matchers.rs b/rust/hg-core/src/matchers.rs new file mode 100644 --- /dev/null +++ b/rust/hg-core/src/matchers.rs @@ -0,0 +1,105 @@ +// matchers.rs +// +// Copyright 2019 Raphaël Gomès +// +// This software may be used and distributed accordin

D7178: [RFC] rust-matchers: add `Matcher` trait and implement `AlwaysMatcher`

2019-10-31 Thread Raphaël Gomès
Alphare added inline comments. INLINE COMMENTS > martinvonz wrote in matchers.rs:20-21 > Is `Empty` needed as an optimization? Or could we just use an empty set? I feel like Rust enums are really cheap to make and maintain, and since the original code hints at possible optimizations for this ca

D7178: [RFC] rust-matchers: add `Matcher` trait and implement `AlwaysMatcher`

2019-10-31 Thread Raphaël Gomès
,105 @@ +// matchers.rs +// +// Copyright 2019 Raphaël Gomès +// +// This software may be used and distributed according to the terms of the +// GNU General Public License version 2 or any later version. + +//! Structs and types for matching files and directories. + +use crate::utils::hg_path::{Hg

D7178: [RFC] rust-matchers: add `Matcher` trait and implement `AlwaysMatcher`

2019-10-29 Thread Raphaël Gomès
GE DETAILS diff --git a/rust/hg-core/src/matchers.rs b/rust/hg-core/src/matchers.rs new file mode 100644 --- /dev/null +++ b/rust/hg-core/src/matchers.rs @@ -0,0 +1,142 @@ +// matchers.rs +// +// Copyright 2019 Raphaël Gomès +// +// This software may be used and distributed according to the terms of t

Re: [PATCH 7 of 7] rust-cpython: mark all PyLeaked methods as unsafe

2019-10-23 Thread Raphaël Gomès
FYI, Georges is currently on vacation, don't expect an answer for at least a week. On 10/22/19 2:53 PM, Yuya Nishihara wrote: On Tue, 22 Oct 2019 14:43:53 +0200, Raphaël Gomès wrote: On 10/22/19 10:11 AM, Yuya Nishihara wrote: diff --git a/rust/hg-cpython/src/ref_sharing.rs b/ru

Re: [PATCH 7 of 7] rust-cpython: mark all PyLeaked methods as unsafe

2019-10-22 Thread Raphaël Gomès
Nice series as always, everything makes sense to me. I will try to dogfood the new API a little bit more in the near future. On 10/22/19 10:17 AM, Yuya Nishihara wrote: On Tue, 22 Oct 2019 17:11:58 +0900, Yuya Nishihara wrote: # HG changeset patch # User Yuya Nishihara # Date 1571727874 -3240

Re: [PATCH 7 of 7] rust-cpython: mark all PyLeaked methods as unsafe

2019-10-22 Thread Raphaël Gomès
On 10/22/19 10:11 AM, Yuya Nishihara wrote: Anyway, this seems not an easy issue, so it's probably better to leave the current interface as unsafe, and get broader comments while upstreaming this feature. Yes, this is unfortunate indeed. I'm all for starting the upstreaming process soon as I elu

Re: [PATCH 1 of 9] rust-cpython: rename PyLeakedRef to PyLeaked

2019-10-19 Thread Raphaël Gomès
Thanks a lot for this series Yuya. This reference-sharing business gets a lot better every time. We should maybe think about bringing Georges and Mark along for the ride for the (near) future upstreaming, don't you think? On 10/19/19 12:07 PM, Yuya Nishihara wrote: # HG changeset patch # Use

Re: [PATCH 4 of 9] rust-cpython: allow mutation unless leaked reference is borrowed

2019-10-19 Thread Raphaël Gomès
On 10/19/19 12:07 PM, Yuya Nishihara wrote: -# since the iterator is potentially not deleted, -# delete the iterator to release the reference for the Rust -# implementation. -# TODO make the Rust implementation behave like Python -# sinc

Re: [PATCH 3 of 9] rust-cpython: add generation counter to leaked reference

2019-10-19 Thread Raphaël Gomès
On 10/19/19 12:07 PM, Yuya Nishihara wrote: +#[should_panic(expected = "map() over invalidated leaked reference")] Should we keep a "registry" of those hardcoded errors? To me they feel like magic numbers. I could be nitpicking a little too hard though __

Re: [PATCH 2 of 9] rust-cpython: add stub wrapper that'll prevent leaked data from being mutated

2019-10-19 Thread Raphaël Gomès
On 10/19/19 12:07 PM, Yuya Nishihara wrote: PyLeakedRef and PyLeakedRefMut could be unified to PyLeakedRef<&T> and PyLeakedRef<&mut T> respectively, but I didn't do that since it seemed a bit weird that deref_mut() would return a mutable reference to an immutable reference. It seems to be the ap

Re: [PATCH 1 of 6 V3] rust-cpython: put leaked reference in PyLeakedRef

2019-10-19 Thread Raphaël Gomès
Great work on this series, thanks. I'll admit it was a little hard to follow all of the intermediary steps needed, but it's better that way for debugging I think. I'll jump on the follow-up. On 10/17/19 3:06 PM, Yuya Nishihara wrote: # HG changeset patch # User Yuya Nishihara # Date 1568552

D7118: rust-dirstatemap: remove additional lookups in traverse

2019-10-18 Thread Raphaël Gomès
Alphare added a comment. In D7118#104834 , @yuja wrote: >> +++ b/mercurial/dirstate.py >> @@ -919,6 +919,9 @@ >> >> matchalways = match.always() >> matchtdir = match.traversedir >> dmap = self._map >> >> +if rustmod i

D7128: rust-dirstate-status: use fast-path even with fsmonitor and sparse extensions

2019-10-18 Thread Raphaël Gomès
Closed by commit rHG93827664a7d7: rust-dirstate-status: use fast-path even with fsmonitor and sparse extensions (authored by Alphare). This revision was automatically updated to reflect the committed changes. This revision was not accepted when it landed; it landed in state "Needs Review". REPOS

D7117: rust-dirstatemap: remove additional lookups in dirstatemap

2019-10-18 Thread Raphaël Gomès
Closed by commit rHG5d4046594d6f: rust-dirstatemap: remove additional lookups in dirstatemap (authored by Alphare). This revision was automatically updated to reflect the committed changes. This revision was not accepted when it landed; it landed in state "Needs Review". REPOSITORY rHG Mercuri

D7128: rust-dirstate-status: use fast-path even with fsmonitor and sparse extensions

2019-10-17 Thread Raphaël Gomès
Alphare created this revision. Herald added subscribers: mercurial-devel, mjpieters. Herald added a reviewer: hg-reviewers. REVISION SUMMARY When I initially ran the tests on my series, there were test failures related to those extensions. Now that the initial series has landed, I felt like go

D7116: rust-performance: introduce FastHashMap type alias for HashMap

2019-10-17 Thread Raphaël Gomès
Alphare added a comment. In D7116#104685 , @kevincox wrote: > I've seen very good results with https://github.com/servo/rust-fnv in the past so it is probably worth including that in the comparison and possibly using it. It is especially good

D7058: rust-dirstate-status: add first Rust implementation of `dirstate.status`

2019-10-16 Thread Raphaël Gomès
8 @@ +// status.rs +// +// Copyright 2019 Raphaël Gomès +// +// This software may be used and distributed according to the terms of the +// GNU General Public License version 2 or any later version. + +//! Rust implementation of dirstate.status (dirstate.py). +//! It is currently missing a lot of functionali

D7059: rust-dirstate-status: rust-cpython bindings for `dirstate.status`

2019-10-16 Thread Raphaël Gomès
diff --git a/rust/hg-cpython/src/dirstate/status.rs b/rust/hg-cpython/src/dirstate/status.rs new file mode 100644 --- /dev/null +++ b/rust/hg-cpython/src/dirstate/status.rs @@ -0,0 +1,82 @@ +// status.rs +// +// Copyright 2019, Raphaël Gomès +// +// This software may be used and distributed accordin

D7060: rust-dirstate-status: add call to rust-fast path for `dirstate.status`

2019-10-16 Thread Raphaël Gomès
Closed by commit rHGa85a71cb383f: rust-dirstate-status: add call to rust-fast path for `dirstate.status` (authored by Alphare). This revision was automatically updated to reflect the committed changes. CHANGED PRIOR TO COMMIT https://phab.mercurial-scm.org/D7060?vs=17253&id=17270#toc REPOSITOR

D7110: rust-refsharing: add missing lifetime parameter in ref_sharing

2019-10-16 Thread Raphaël Gomès
Closed by commit rHGb902066d9b86: rust-refsharing: add missing lifetime parameter in ref_sharing (authored by Alphare). This revision was automatically updated to reflect the committed changes. REPOSITORY rHG Mercurial CHANGES SINCE LAST UPDATE https://phab.mercurial-scm.org/D7110?vs=17182&i

D7058: rust-dirstate-status: add first Rust implementation of `dirstate.status`

2019-10-16 Thread Raphaël Gomès
b/rust/hg-core/src/dirstate/status.rs new file mode 100644 --- /dev/null +++ b/rust/hg-core/src/dirstate/status.rs @@ -0,0 +1,248 @@ +// status.rs +// +// Copyright 2019 Raphaël Gomès +// +// This software may be used and distributed according to the terms of the +// GNU General Public License vers

D7060: rust-dirstate-status: add call to rust-fast path for `dirstate.status`

2019-10-16 Thread Raphaël Gomès
Alphare updated this revision to Diff 17253. REPOSITORY rHG Mercurial CHANGES SINCE LAST UPDATE https://phab.mercurial-scm.org/D7060?vs=17067&id=17253 CHANGES SINCE LAST ACTION https://phab.mercurial-scm.org/D7060/new/ REVISION DETAIL https://phab.mercurial-scm.org/D7060 AFFECTED FILES

D7107: rust-cross-platform: remove `unimplemented!` to get compile-time errors instead

2019-10-16 Thread Raphaël Gomès
Closed by commit rHG3f21d1c1bba5: rust-cross-platform: remove `unimplemented!` to get compile-time errors (authored by Alphare). This revision was automatically updated to reflect the committed changes. REPOSITORY rHG Mercurial CHANGES SINCE LAST UPDATE https://phab.mercurial-scm.org/D7107?v

D7057: rust-utils: introduce a debug util to print the python stack trace

2019-10-16 Thread Raphaël Gomès
Closed by commit rHG886f0822a38e: rust-utils: introduce a debug util to print the python stack trace (authored by Alphare). This revision was automatically updated to reflect the committed changes. REPOSITORY rHG Mercurial CHANGES SINCE LAST UPDATE https://phab.mercurial-scm.org/D7057?vs=170

D7115: rust-dependencies: pin the dependencies of hg-core to prevent breakage

2019-10-16 Thread Raphaël Gomès
Closed by commit rHG8607818012e7: rust-dependencies: pin the dependencies of hg-core to prevent breakage (authored by Alphare). This revision was automatically updated to reflect the committed changes. REPOSITORY rHG Mercurial CHANGES SINCE LAST UPDATE https://phab.mercurial-scm.org/D7115?vs

D7119: rust-dirstatemap: remove additional lookup in dirstate.matches

2019-10-16 Thread Raphaël Gomès
Alphare created this revision. Herald added a subscriber: mercurial-devel. Herald added a reviewer: hg-reviewers. REVISION SUMMARY We use the same trick as the Python implementation REPOSITORY rHG Mercurial REVISION DETAIL https://phab.mercurial-scm.org/D7119 AFFECTED FILES mercurial/di

D7118: rust-dirstatemap: remove additional lookups in traverse

2019-10-16 Thread Raphaël Gomès
Alphare created this revision. Herald added a subscriber: mercurial-devel. Herald added a reviewer: hg-reviewers. REVISION SUMMARY We use the same trick as the Python implementation. REPOSITORY rHG Mercurial REVISION DETAIL https://phab.mercurial-scm.org/D7118 AFFECTED FILES mercurial/d

D7117: rust-dirstatemap: remove additional lookups in dirstatemap

2019-10-16 Thread Raphaël Gomès
Alphare created this revision. Herald added a subscriber: mercurial-devel. Herald added a reviewer: hg-reviewers. REVISION SUMMARY We're copying this shortcut from the Python implementation, pretty standard for this codebase. REPOSITORY rHG Mercurial REVISION DETAIL https://phab.mercuria

D7116: rust-performance: introduce FastHashMap type alias for HashMap

2019-10-16 Thread Raphaël Gomès
Alphare created this revision. Herald added subscribers: mercurial-devel, kevincox, durin42. Herald added a reviewer: hg-reviewers. REVISION SUMMARY 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 tho

D7115: rust-dependencies: pin the dependencies of hg-core to prevent breakage

2019-10-16 Thread Raphaël Gomès
Alphare created this revision. Herald added a subscriber: mercurial-devel. Herald added a reviewer: hg-reviewers. REVISION SUMMARY A new version of the `rand` crate broke two discovery tests. We should upgrade our dependencies periodically manually. REPOSITORY rHG Mercurial REVISION DETAIL

D7058: rust-dirstate-status: add first Rust implementation of `dirstate.status`

2019-10-16 Thread Raphaël Gomès
b/rust/hg-core/src/dirstate/status.rs new file mode 100644 --- /dev/null +++ b/rust/hg-core/src/dirstate/status.rs @@ -0,0 +1,246 @@ +// status.rs +// +// Copyright 2019 Raphaël Gomès +// +// This software may be used and distributed according to the terms of the +// GNU General Public License vers

D7058: rust-dirstate-status: add first Rust implementation of `dirstate.status`

2019-10-15 Thread Raphaël Gomès
b/rust/hg-core/src/dirstate/status.rs new file mode 100644 --- /dev/null +++ b/rust/hg-core/src/dirstate/status.rs @@ -0,0 +1,246 @@ +// status.rs +// +// Copyright 2019 Raphaël Gomès +// +// This software may be used and distributed according to the terms of the +// GNU General Public License vers

D7059: rust-dirstate-status: rust-cpython bindings for `dirstate.status`

2019-10-15 Thread Raphaël Gomès
/src/dirstate/status.rs @@ -0,0 +1,82 @@ +// status.rs +// +// Copyright 2019, Raphaël Gomès +// +// This software may be used and distributed according to the terms of the +// GNU General Public License version 2 or any later version. + +//! Bindings for the `hg::status` module provided by the +//!

D7058: rust-dirstate-status: add first Rust implementation of `dirstate.status`

2019-10-15 Thread Raphaël Gomès
Alphare added inline comments. INLINE COMMENTS > martinvonz wrote in status.rs:24 > Do we need to borrow it mutably? We don't anymore, thanks. I'll be reworking the overly complicated match expression within the next hour. REPOSITORY rHG Mercurial CHANGES SINCE LAST ACTION https://phab.me

D7058: rust-dirstate-status: add first Rust implementation of `dirstate.status`

2019-10-15 Thread Raphaël Gomès
b/rust/hg-core/src/dirstate/status.rs new file mode 100644 --- /dev/null +++ b/rust/hg-core/src/dirstate/status.rs @@ -0,0 +1,250 @@ +// status.rs +// +// Copyright 2019 Raphaël Gomès +// +// This software may be used and distributed according to the terms of the +// GNU General Public License vers

D7059: rust-dirstate-status: rust-cpython bindings for `dirstate.status`

2019-10-15 Thread Raphaël Gomès
/src/dirstate/status.rs @@ -0,0 +1,82 @@ +// status.rs +// +// Copyright 2019, Raphaël Gomès +// +// This software may be used and distributed according to the terms of the +// GNU General Public License version 2 or any later version. + +//! Bindings for the `hg::status` module provided by the +//!

D7110: rust-status: add missing lifetime parameter in ref_sharing

2019-10-15 Thread Raphaël Gomès
Alphare created this revision. Herald added subscribers: mercurial-devel, kevincox, durin42. Herald added a reviewer: hg-reviewers. REPOSITORY rHG Mercurial REVISION DETAIL https://phab.mercurial-scm.org/D7110 AFFECTED FILES rust/hg-cpython/src/ref_sharing.rs CHANGE DETAILS diff --git a/

D7058: rust-dirstate-status: add first Rust implementation of `dirstate.status`

2019-10-15 Thread Raphaël Gomès
b/rust/hg-core/src/dirstate/status.rs new file mode 100644 --- /dev/null +++ b/rust/hg-core/src/dirstate/status.rs @@ -0,0 +1,250 @@ +// status.rs +// +// Copyright 2019 Raphaël Gomès +// +// This software may be used and distributed according to the terms of the +// GNU General Public License vers

D7059: rust-dirstate-status: rust-cpython bindings for `dirstate.status`

2019-10-15 Thread Raphaël Gomès
/src/dirstate/status.rs @@ -0,0 +1,82 @@ +// status.rs +// +// Copyright 2019, Raphaël Gomès +// +// This software may be used and distributed according to the terms of the +// GNU General Public License version 2 or any later version. + +//! Bindings for the `hg::status` module provided by the +//!

D7058: rust-dirstate-status: add first Rust implementation of `dirstate.status`

2019-10-15 Thread Raphaël Gomès
Alphare added inline comments. Alphare marked an inline comment as done. INLINE COMMENTS > kevincox wrote in status.rs:23 > This doesn't appear to be consumed by the function so you should take a > `&[HgPathBuf]`. Or since I don't think you use the path either probably a > `&[HgPath]`. Done wi

D7107: rust-cross-platform: remove `unimplemented!` to get compile-time errors instead

2019-10-15 Thread Raphaël Gomès
Alphare created this revision. Herald added subscribers: mercurial-devel, kevincox, durin42. Herald added a reviewer: hg-reviewers. REVISION SUMMARY We should get a compile-time error that there is missing functionality for the targeted platform instead of the program breaking at runtime. REP

D7058: rust-dirstate-status: add first Rust implementation of `dirstate.status`

2019-10-15 Thread Raphaël Gomès
CopyMap, CopyMapIter, DirstateEntry, DirstateParents, EntryState, StateMap, StateMapIter, }; diff --git a/rust/hg-core/src/dirstate/status.rs b/rust/hg-core/src/dirstate/status.rs new file mode 100644 --- /dev/null +++ b/rust/hg-core/src/dirstate/status.rs @@ -0,0 +1,251 @@ +// status.rs +// +// C

D7058: rust-dirstate-status: add first Rust implementation of `dirstate.status`

2019-10-15 Thread Raphaël Gomès
0,0 +1,251 @@ +// status.rs +// +// Copyright 2019 Raphaël Gomès +// +// This software may be used and distributed according to the terms of the +// GNU General Public License version 2 or any later version. + +//! Rust implementation of dirstate.status (dirstate.py). +//! It is currently missing a lot of fu

D7059: rust-dirstate-status: rust-cpython bindings for `dirstate.status`

2019-10-15 Thread Raphaël Gomès
/src/dirstate/status.rs @@ -0,0 +1,82 @@ +// status.rs +// +// Copyright 2019, Raphaël Gomès +// +// This software may be used and distributed according to the terms of the +// GNU General Public License version 2 or any later version. + +//! Bindings for the `hg::status` module provided by the +//!

D7058: rust-dirstate-status: add first Rust implementation of `dirstate.status`

2019-10-15 Thread Raphaël Gomès
Alphare added a comment. In D7058#103954 , @yuja wrote: > Just quickly scanned. Not reviewed the core logic. > >> +/// Get name in the case stored in the filesystem >> +/// The name should be relative to root, and be normcase-ed for effic

Re: Mercurial 5.2 release as stable release for Python 3.

2019-10-14 Thread Raphaël Gomès
On 10/14/19 7:08 PM, Gregory Szorc wrote: I support marking the code base as stable with Python 3 in the upcoming few weeks - at least for non-Windows. If we're serious about this, we all need to be running Mercurial with Python 3 locally and fixing bugs. I tried installing a Python 3 Mercur

D7058: rust-dirstate-status: add first Rust implementation of `dirstate.status`

2019-10-14 Thread Raphaël Gomès
StateMap, StateMapIter, }; diff --git a/rust/hg-core/src/dirstate/status.rs b/rust/hg-core/src/dirstate/status.rs new file mode 100644 --- /dev/null +++ b/rust/hg-core/src/dirstate/status.rs @@ -0,0 +1,254 @@ +// status.rs +// +// Copyright 2019 Raphaël Gomès +// +// This software may be used

D7058: rust-dirstate-status: add first Rust implementation of `dirstate.status`

2019-10-14 Thread Raphaël Gomès
StateMap, StateMapIter, }; diff --git a/rust/hg-core/src/dirstate/status.rs b/rust/hg-core/src/dirstate/status.rs new file mode 100644 --- /dev/null +++ b/rust/hg-core/src/dirstate/status.rs @@ -0,0 +1,254 @@ +// status.rs +// +// Copyright 2019 Raphaël Gomès +// +// This software may be used

D7058: rust-dirstate-status: add first Rust implementation of `dirstate.status`

2019-10-14 Thread Raphaël Gomès
Alphare added a comment. Alphare marked 3 inline comments as done. @martinvonz First of all, thanks a lot for starting the Rust reviews, your feedback is very helpful. For most of your comments, I tried cutting out the parts of the implementation that were not needed yet but did not go f

Re: [PATCH 1 of 5] rust-cpython: put leaked reference in PyLeakedRef

2019-10-14 Thread Raphaël Gomès
I think Georges reviewed the other patch series. I'll be taking a closer look at this one as soon as I finish mine. On 10/14/19 7:41 AM, Martin von Zweigbergk via Mercurial-devel wrote: I'll queue this mostly based on Georges' review, thanks. ___ M

D7058: rust-dirstate-status: add first Rust implementation of `dirstate.status`

2019-10-11 Thread Raphaël Gomès
++ b/rust/hg-core/src/dirstate/status.rs @@ -0,0 +1,280 @@ +// status.rs +// +// Copyright 2019 Raphaël Gomès +// +// This software may be used and distributed according to the terms of the +// GNU General Public License version 2 or any later version. + +//! Rust implementation of dirstate.status (

D7059: rust-dirstate-status: rust-cpython bindings for `dirstate.status`

2019-10-11 Thread Raphaël Gomès
file mode 100644 --- /dev/null +++ b/rust/hg-cpython/src/dirstate/status.rs @@ -0,0 +1,82 @@ +// status.rs +// +// Copyright 2019, Raphaël Gomès +// +// This software may be used and distributed according to the terms of the +// GNU General Public License version 2 or any later version

D7060: rust-dirstate-status: add call to rust-fast path for `dirstate.status`

2019-10-11 Thread Raphaël Gomès
Alphare created this revision. Herald added subscribers: mercurial-devel, mjpieters. Herald added a reviewer: hg-reviewers. REVISION SUMMARY The reasoning behind this patch is explained in the first patch of the series. REPOSITORY rHG Mercurial REVISION DETAIL https://phab.mercurial-scm.or

Re: [PATCH 01 of 10] rust-cpython: move py_shared_state to PySharedRefCell object

2019-10-11 Thread Raphaël Gomès
Just for the record, "the series" means patches 1-8, as 9 and 10 are unsafe. On 10/11/19 3:13 PM, Pulkit Goyal wrote: On Sun, Sep 22, 2019 at 9:51 AM Yuya Nishihara wrote: # HG changeset patch # User Yuya Nishihara # Date 1568469711 -32400 # Sat Sep 14 23:01:51 2019 +0900 # Node ID e7f64

D7057: rust-utils: introduce a debug util to print the python stack trace

2019-10-11 Thread Raphaël Gomès
Alphare created this revision. Herald added subscribers: mercurial-devel, kevincox, durin42. Herald added a reviewer: hg-reviewers. REPOSITORY rHG Mercurial REVISION DETAIL https://phab.mercurial-scm.org/D7057 AFFECTED FILES rust/hg-cpython/src/lib.rs rust/hg-cpython/src/utils.rs CHANGE

Re: [PATCH 10 of 10] rust-cpython: add safe way to map PyLeakedRef<&T> to PyLeakedRef

2019-10-11 Thread Raphaël Gomès
Also, rust-cpython will need tests to upstream. I also think that it's a good idea to have tests when dealing with unsafe boundaries. On 10/10/19 9:21 PM, Raphaël Gomès wrote: Indeed, I don't think there is a way to prevent this. We might get additional feedback when upstreami

Re: [PATCH 10 of 10] rust-cpython: add safe way to map PyLeakedRef<&T> to PyLeakedRef

2019-10-10 Thread Raphaël Gomès
Indeed, I don't think there is a way to prevent this. We might get additional feedback when upstreaming to rust-cpython though. Rest of the series looks good to me. This is all a needed improvement. On 10/10/19 4:34 PM, Yuya Nishihara wrote: On Thu, 10 Oct 2019 13:53:54 +0200, Raphaël

Re: [PATCH 10 of 10] rust-cpython: add safe way to map PyLeakedRef<&T> to PyLeakedRef

2019-10-10 Thread Raphaël Gomès
Is it not possible to just take a `fn` type? It forces a non-capturing fn. On 10/8/19 7:16 PM, Yuya Nishihara wrote: +pub fn map( +mut self, +py: Python, +f: impl FnOnce(T) -> U, +) -> PyLeakedRef { +PyLeakedRef { +inner: self.inner.clone_ref(p

Re: [PATCH 08 of 13] perf: document `perfdirfoldmap`

2019-10-10 Thread Raphaël Gomès
I think your itch to refactor is premature. It's two different maps that happen to have similar names, I wouldn't worry about it. On 10/9/19 4:21 PM, Pierre-Yves David wrote: On 10/9/19 4:19 PM, Pulkit Goyal wrote: On Tue, Oct 8, 2019 at 8:45 PM Pierre-Yves David wrote: # HG changeset patch

Re: [PATCH] rust-cpython: change license of ref_sharing.rs to MIT

2019-10-06 Thread Raphaël Gomès
x27;s better to continue further refactoring under the same license as rust-cpython crate. According to the file history, copyright holders are: - Raphaël Gomès - Valentin Gatien-Baron - Yuya Nishihara Will queue this after black and byte-ify string refactoring lan

Re: [PATCH 03 of 10] rust-cpython: mark PySharedState as Sync so &'PySharedState can be Send

2019-10-05 Thread Raphaël Gomès
Poisoning is the way to go in the long run. I haven't really thought about how much of a pain this could be. On 10/5/19 5:03 PM, Yuya Nishihara wrote: On Sun, 22 Sep 2019 15:41:40 +0900, Yuya Nishihara wrote: # HG changeset patch # User Yuya Nishihara # Date 1568674765 -32400 # Tue Sep 1

D6774: rust-hgpath: replace all paths and filenames with HgPath/HgPathBuf

2019-09-21 Thread Raphaël Gomès
Closed by commit rHG7a01778bc7b7: rust-hgpath: replace all paths and filenames with HgPath/HgPathBuf (authored by Alphare). This revision was automatically updated to reflect the committed changes. This revision was not accepted when it landed; it landed in state "Needs Review". REPOSITORY rHG

D6773: rust-hgpath: add HgPath and HgPathBuf structs to encapsulate handling of paths

2019-09-21 Thread Raphaël Gomès
.rs @@ -0,0 +1,409 @@ +// hg_path.rs +// +// Copyright 2019 Raphaël Gomès +// +// This software may be used and distributed according to the terms of the +// GNU General Public License version 2 or any later version. + +use std::borrow::Borrow; +use std::ffi::{OsStr, OsString}; +use std::ops::Deref; +us

D6859: rust-cpython: mark PySharedState as Sync so &'PySharedState can be Send (RFC)

2019-09-17 Thread Raphaël Gomès
Alphare added a comment. It is indeed `Sync` because the `py_class!` macro forces us to have a reference to the GIL at the type level to access the data attributes, but I would also like to be extra sure and have someone else confirm it. REPOSITORY rHG Mercurial CHANGES SINCE LAST ACTION

Re: [PATCH] rust-cpython: add sanity check to PySharedState::decrease_leak_count()

2019-09-15 Thread Raphaël Gomès
Good idea, thanks! On 9/15/19 6:29 PM, Yuya Nishihara wrote: # HG changeset patch # User Yuya Nishihara # Date 1568555012 -32400 # Sun Sep 15 22:43:32 2019 +0900 # Node ID 071b35e3f7cde53cbf411a536091153741dc4a37 # Parent 34ed651ba7e4a4b7f0ee79c5a5442b5eed27bbad rust-cpython: add sanity c

Re: [PATCH evolve-ext] docs: add example for the `prune` command

2019-09-13 Thread Raphaël Gomès
Done as a merge request on https://dev.heptapod.net/mercurial/evolve, thanks for reminding me On 9/13/19 3:56 PM, Anton Shestakov wrote: This patch seems to have fallen entirely through the cracks. Try CCing marmoute in V2. On Fri, 19 Jul 2019 16:29:42 +0200 Raphaël Gomès wrote: # HG

D6774: rust-hgpath: replace all paths and filenames with HgPath/HgPathBuf

2019-09-13 Thread Raphaël Gomès
Alphare added inline comments. INLINE COMMENTS > kevincox wrote in files.rs:75 > Is this used? Can you either use, delete or add tests. I think the rebase fixed the diff. REPOSITORY rHG Mercurial CHANGES SINCE LAST ACTION https://phab.mercurial-scm.org/D6774/new/ REVISION DETAIL https:/

D6774: rust-hgpath: replace all paths and filenames with HgPath/HgPathBuf

2019-09-13 Thread Raphaël Gomès
Alphare updated this revision to Diff 16530. REPOSITORY rHG Mercurial CHANGES SINCE LAST UPDATE https://phab.mercurial-scm.org/D6774?vs=16367&id=16530 CHANGES SINCE LAST ACTION https://phab.mercurial-scm.org/D6774/new/ REVISION DETAIL https://phab.mercurial-scm.org/D6774 AFFECTED FILES

D6773: rust-hgpath: add HgPath and HgPathBuf structs to encapsulate handling of paths

2019-09-13 Thread Raphaël Gomès
2019 Raphaël Gomès +// +// This software may be used and distributed according to the terms of the +// GNU General Public License version 2 or any later version. + +use std::borrow::Borrow; +use std::ffi::{OsStr, OsString}; +use std::ops::Deref; +use std::path::{Path, PathBuf}; + +/// This is a reposi

D6836: interfaces: introduce an interface for dirstate implementations

2019-09-13 Thread Raphaël Gomès
Alphare added inline comments. INLINE COMMENTS > dirstate.py:37 > + > +_map = interfaceutil.Attribute( > +"""Return the dirstate contents (see documentation for dirstatemap). Shouldn't this be removed? REPOSITORY rHG Mercurial CHANGES SINCE LAST ACTION https://phab.mercurial-sc

D6773: rust-hgpath: add HgPath and HgPathBuf structs to encapsulate handling of paths

2019-09-11 Thread Raphaël Gomès
Alphare added a comment. I would love for this series to be queued. Is there anything I didn't address left to do? REPOSITORY rHG Mercurial CHANGES SINCE LAST ACTION https://phab.mercurial-scm.org/D6773/new/ REVISION DETAIL https://phab.mercurial-scm.org/D6773 To: Alphare, #hg-review

Re: [PATCH 7 of 7] rust-cpython: leverage py_shared_iterator::from_inner() where appropriate

2019-09-09 Thread Raphaël Gomès
Looking back, my initial macro was a bit over-engineered, the concrete types should be an improvement to maintainability, since they're restricted to one `py_class!`. This whole series looks good to me, thanks a lot. On 9/8/19 12:05 PM, Yuya Nishihara wrote: # HG changeset patch # User Yuya N

<    5   6   7   8   9   10   11   12   13   >