D7863: rust-utils: add util to find a slice in another slice

2020-01-14 Thread Raphaël Gomès
Closed by commit rHGed57b3557443: rust-utils: add util to find a slice in another slice (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/D7863?vs=19255&id=19274

D7862: dirstate: move rust fast-path calling code to its own method

2020-01-15 Thread Raphaël Gomès
Alphare added a comment. In D7862#115784 , @pulkit wrote: > Absorbing the following diff to make `test-check-format.t` happy: Sorry about that. REPOSITORY rHG Mercurial CHANGES SINCE LAST ACTION https://phab.mercurial-scm.org/D7862/ne

Nlnet funding for transitioning out of SHA-1

2020-01-15 Thread Raphaël Gomès
Hello all, As you all know, we have to transition out of using SHA-1 for Mercurial (https://www.mercurial-scm.org/wiki/SHA1TransitionPlan). While a known mitigation has been introduced by a few of Augie's patches, we still have to act on that transition. The Nlnet foundation has a program (h

D7864: rust-utils: add Rust implementation of Python's "os.path.splitdrive"

2020-01-15 Thread Raphaël Gomès
Alphare added inline comments. INLINE COMMENTS > kevincox wrote in files.rs:109 > I think this can be simplified. See > https://play.rust-lang.org/?version=stable&mode=debug&edition=2018&gist=78136ead96596afe6305e7542a881ca4. > I had to use &[u8] to avoid having to copy all of the HgPath stuff

D7864: rust-utils: add Rust implementation of Python's "os.path.splitdrive"

2020-01-15 Thread Raphaël Gomès
Alphare added inline comments. INLINE COMMENTS > kevincox wrote in files.rs:109 > I would recommend just converting to bytes at the top of the function then > converting the return value to a path at the exit. I feel when you are doing > manipulation like this it makes the most sense to treat i

D7866: rust-pathauditor: add Rust implementation of the `pathauditor`

2020-01-15 Thread Raphaël Gomès
Alphare added inline comments. Alphare marked 2 inline comments as done. INLINE COMMENTS > kevincox wrote in path_auditor.rs:54 > It would be nice to have this in a helper function in path to get a component > iterator. I think that's a good idea indeed, but I would prefer to do it in another p

D7862: dirstate: move rust fast-path calling code to its own method

2020-01-15 Thread Raphaël Gomès
Alphare updated this revision to Diff 19314. REPOSITORY rHG Mercurial CHANGES SINCE LAST UPDATE https://phab.mercurial-scm.org/D7862?vs=19273&id=19314 BRANCH default CHANGES SINCE LAST ACTION https://phab.mercurial-scm.org/D7862/new/ REVISION DETAIL https://phab.mercurial-scm.org/D78

D7863: rust-utils: add util to find a slice in another slice

2020-01-15 Thread Raphaël Gomès
Alphare updated this revision to Diff 19315. REPOSITORY rHG Mercurial CHANGES SINCE LAST UPDATE https://phab.mercurial-scm.org/D7863?vs=19274&id=19315 BRANCH default CHANGES SINCE LAST ACTION https://phab.mercurial-scm.org/D7863/new/ REVISION DETAIL https://phab.mercurial-scm.org/D78

D7864: rust-utils: add Rust implementation of Python's "os.path.splitdrive"

2020-01-15 Thread Raphaël Gomès
Alphare updated this revision to Diff 19316. REPOSITORY rHG Mercurial CHANGES SINCE LAST UPDATE https://phab.mercurial-scm.org/D7864?vs=19256&id=19316 BRANCH default CHANGES SINCE LAST ACTION https://phab.mercurial-scm.org/D7864/new/ REVISION DETAIL https://phab.mercurial-scm.org/D78

D7867: rust-hg-path: add useful methods to `HgPath`

2020-01-15 Thread Raphaël Gomès
Alphare updated this revision to Diff 19318. REPOSITORY rHG Mercurial CHANGES SINCE LAST UPDATE https://phab.mercurial-scm.org/D7867?vs=19259&id=19318 BRANCH default CHANGES SINCE LAST ACTION https://phab.mercurial-scm.org/D7867/new/ REVISION DETAIL https://phab.mercurial-scm.org/D78

D7870: rust-utils: add `Escaped` trait

2020-01-15 Thread Raphaël Gomès
Alphare retitled this revision from "rust-utils: add `PrettyPrint` trait" to "rust-utils: add `Escaped` trait". Alphare updated this revision to Diff 19320. REPOSITORY rHG Mercurial CHANGES SINCE LAST UPDATE https://phab.mercurial-scm.org/D7870?vs=19262&id=19320 BRANCH default CHANGES SI

D7870: rust-utils: add `Escaped` trait

2020-01-15 Thread Raphaël Gomès
Alphare added a comment. In D7870#115935 , @kevincox wrote: > I'm not convinced PrettyPrint is the best name. I might call it something more to do with escaping instead of "pretty". However I can't think of anything great. Yeah, I am not

D7869: rust-dirs-multiset: add `DirsChildrenMultiset`

2020-01-15 Thread Raphaël Gomès
Alphare marked 2 inline comments as done. Alphare updated this revision to Diff 19319. REPOSITORY rHG Mercurial CHANGES SINCE LAST UPDATE https://phab.mercurial-scm.org/D7869?vs=19261&id=19319 BRANCH default CHANGES SINCE LAST ACTION https://phab.mercurial-scm.org/D7869/new/ REVISION D

D7866: rust-pathauditor: add Rust implementation of the `pathauditor`

2020-01-15 Thread Raphaël Gomès
tils/path_auditor.rs new file mode 100644 --- /dev/null +++ b/rust/hg-core/src/utils/path_auditor.rs @@ -0,0 +1,235 @@ +// path_auditor.rs +// +// Copyright 2020 +// Raphaël Gomès , +// +// This software may be used and distributed according to the terms of the +// GNU General Public License version

D7871: rust-utils: add util for canonical path

2020-01-15 Thread Raphaël Gomès
Alphare updated this revision to Diff 19321. REPOSITORY rHG Mercurial CHANGES SINCE LAST UPDATE https://phab.mercurial-scm.org/D7871?vs=19263&id=19321 BRANCH default CHANGES SINCE LAST ACTION https://phab.mercurial-scm.org/D7871/new/ REVISION DETAIL https://phab.mercurial-scm.org/D78

D7870: rust-utils: add `Escaped` trait

2020-01-16 Thread Raphaël Gomès
Alphare updated this revision to Diff 19348. REPOSITORY rHG Mercurial CHANGES SINCE LAST UPDATE https://phab.mercurial-scm.org/D7870?vs=19320&id=19348 BRANCH default CHANGES SINCE LAST ACTION https://phab.mercurial-scm.org/D7870/new/ REVISION DETAIL https://phab.mercurial-scm.org/D78

D7871: rust-utils: add util for canonical path

2020-01-16 Thread Raphaël Gomès
Alphare updated this revision to Diff 19349. REPOSITORY rHG Mercurial CHANGES SINCE LAST UPDATE https://phab.mercurial-scm.org/D7871?vs=19321&id=19349 BRANCH default CHANGES SINCE LAST ACTION https://phab.mercurial-scm.org/D7871/new/ REVISION DETAIL https://phab.mercurial-scm.org/D78

D7864: rust-utils: add Rust implementation of Python's "os.path.splitdrive"

2020-01-16 Thread Raphaël Gomès
Alphare added a comment. In D7864#116100 , @kevincox wrote: > One last note is why not just put this in HgPath? I was about to start making this a method on `HgPath`, I guess we agree. REPOSITORY rHG Mercurial CHANGES SINCE LAST ACTION

D7864: rust-utils: add Rust implementation of Python's "os.path.splitdrive"

2020-01-16 Thread Raphaël Gomès
Alphare updated this revision to Diff 19350. REPOSITORY rHG Mercurial CHANGES SINCE LAST UPDATE https://phab.mercurial-scm.org/D7864?vs=19316&id=19350 BRANCH default CHANGES SINCE LAST ACTION https://phab.mercurial-scm.org/D7864/new/ REVISION DETAIL https://phab.mercurial-scm.org/D78

D7867: rust-hg-path: add useful methods to `HgPath`

2020-01-16 Thread Raphaël Gomès
Alphare updated this revision to Diff 19352. REPOSITORY rHG Mercurial CHANGES SINCE LAST UPDATE https://phab.mercurial-scm.org/D7867?vs=19318&id=19352 BRANCH default CHANGES SINCE LAST ACTION https://phab.mercurial-scm.org/D7867/new/ REVISION DETAIL https://phab.mercurial-scm.org/D78

D7871: rust-utils: add util for canonical path

2020-01-16 Thread Raphaël Gomès
Alphare updated this revision to Diff 19354. REPOSITORY rHG Mercurial CHANGES SINCE LAST UPDATE https://phab.mercurial-scm.org/D7871?vs=19349&id=19354 BRANCH default CHANGES SINCE LAST ACTION https://phab.mercurial-scm.org/D7871/new/ REVISION DETAIL https://phab.mercurial-scm.org/D78

D7869: rust-dirs-multiset: add `DirsChildrenMultiset`

2020-01-16 Thread Raphaël Gomès
Alphare updated this revision to Diff 19353. REPOSITORY rHG Mercurial CHANGES SINCE LAST UPDATE https://phab.mercurial-scm.org/D7869?vs=19319&id=19353 BRANCH default CHANGES SINCE LAST ACTION https://phab.mercurial-scm.org/D7869/new/ REVISION DETAIL https://phab.mercurial-scm.org/D78

D7866: rust-pathauditor: add Rust implementation of the `pathauditor`

2020-01-16 Thread Raphaël Gomès
tils/path_auditor.rs new file mode 100644 --- /dev/null +++ b/rust/hg-core/src/utils/path_auditor.rs @@ -0,0 +1,235 @@ +// path_auditor.rs +// +// Copyright 2020 +// Raphaël Gomès , +// +// This software may be used and distributed according to the terms of the +// GNU General Public License version

D7908: rust-filepatterns: improve API and robustness for pattern files parsing

2020-01-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 Within the next few patches we will be using this new API. REPOSITORY rHG Mercurial BRANCH default REVISION DETAIL https://phab.mercurial-

D7908: rust-filepatterns: improve API and robustness for pattern files parsing

2020-01-16 Thread Raphaël Gomès
Alphare updated this revision to Diff 19356. REPOSITORY rHG Mercurial CHANGES SINCE LAST UPDATE https://phab.mercurial-scm.org/D7908?vs=19355&id=19356 BRANCH default CHANGES SINCE LAST ACTION https://phab.mercurial-scm.org/D7908/new/ REVISION DETAIL https://phab.mercurial-scm.org/D79

D7909: rust-filepatterns: add support for `ignore` and `subignore` patterns

2020-01-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 This prepares a future patch for `IncludeMatcher` on the road to bare `hg status` support. REPOSITORY rHG Mercurial BRANCH default REVISIO

D7909: rust-filepatterns: add support for `ignore` and `subignore` patterns

2020-01-16 Thread Raphaël Gomès
Alphare added a comment. Note to reviewers: this stack is part of the larger series of getting a full Rust dirstate.status which is most of the performance hit in bare hg status. More patches are coming, but I figured I would send the patches as I go to help with review timing. REPOSITORY

D7869: rust-dirs-multiset: add `DirsChildrenMultiset`

2020-01-16 Thread Raphaël Gomès
Alphare updated this revision to Diff 19358. REPOSITORY rHG Mercurial CHANGES SINCE LAST UPDATE https://phab.mercurial-scm.org/D7869?vs=19353&id=19358 BRANCH default CHANGES SINCE LAST ACTION https://phab.mercurial-scm.org/D7869/new/ REVISION DETAIL https://phab.mercurial-scm.org/D78

D7871: rust-utils: add util for canonical path

2020-01-16 Thread Raphaël Gomès
Alphare updated this revision to Diff 19359. REPOSITORY rHG Mercurial CHANGES SINCE LAST UPDATE https://phab.mercurial-scm.org/D7871?vs=19354&id=19359 BRANCH default CHANGES SINCE LAST ACTION https://phab.mercurial-scm.org/D7871/new/ REVISION DETAIL https://phab.mercurial-scm.org/D78

D7910: rust-re2: add wrapper for calling Re2 from Rust

2020-01-16 Thread Raphaël Gomès
/hg-core/src/lib.rs --- a/rust/hg-core/src/lib.rs +++ b/rust/hg-core/src/lib.rs @@ -21,6 +21,8 @@ pub mod matchers; pub mod revlog; pub use revlog::*; +#[cfg(feature = "with-re2")] +pub mod re2; pub mod utils; use crate::utils::hg_path::{HgPathBuf, HgPathError}; diff --git a/rust/hg

D7494: localrepo: fastpath access to "."

2020-01-16 Thread Raphaël Gomès
Alphare updated this revision to Diff 19362. REPOSITORY rHG Mercurial CHANGES SINCE LAST UPDATE https://phab.mercurial-scm.org/D7494?vs=18383&id=19362 BRANCH default CHANGES SINCE LAST ACTION https://phab.mercurial-scm.org/D7494/new/ REVISION DETAIL https://phab.mercurial-scm.org/D74

D7498: localrepo: also fast past the parents of working copies parents

2020-01-16 Thread Raphaël Gomès
Alphare updated this revision to Diff 19364. REPOSITORY rHG Mercurial CHANGES SINCE LAST UPDATE https://phab.mercurial-scm.org/D7498?vs=18385&id=19364 BRANCH default CHANGES SINCE LAST ACTION https://phab.mercurial-scm.org/D7498/new/ REVISION DETAIL https://phab.mercurial-scm.org/D74

D7495: localrepo: recognize trivial request for '.'

2020-01-16 Thread Raphaël Gomès
Alphare updated this revision to Diff 19363. REPOSITORY rHG Mercurial CHANGES SINCE LAST UPDATE https://phab.mercurial-scm.org/D7495?vs=18384&id=19363 BRANCH default CHANGES SINCE LAST ACTION https://phab.mercurial-scm.org/D7495/new/ REVISION DETAIL https://phab.mercurial-scm.org/D74

D7501: changectx: use unfiltered changelog to walk ancestors in annotate

2020-01-16 Thread Raphaël Gomès
Alphare updated this revision to Diff 19365. REPOSITORY rHG Mercurial CHANGES SINCE LAST UPDATE https://phab.mercurial-scm.org/D7501?vs=18386&id=19365 BRANCH default CHANGES SINCE LAST ACTION https://phab.mercurial-scm.org/D7501/new/ REVISION DETAIL https://phab.mercurial-scm.org/D75

D7502: changectx: mark parent of changesets as non filtered

2020-01-16 Thread Raphaël Gomès
Alphare updated this revision to Diff 19366. REPOSITORY rHG Mercurial CHANGES SINCE LAST UPDATE https://phab.mercurial-scm.org/D7502?vs=18387&id=19366 BRANCH default CHANGES SINCE LAST ACTION https://phab.mercurial-scm.org/D7502/new/ REVISION DETAIL https://phab.mercurial-scm.org/D75

D7492: localrepo: also fastpath access to working copy parents when possible

2020-01-16 Thread Raphaël Gomès
Alphare updated this revision to Diff 19361. REPOSITORY rHG Mercurial CHANGES SINCE LAST UPDATE https://phab.mercurial-scm.org/D7492?vs=18382&id=19361 BRANCH default CHANGES SINCE LAST ACTION https://phab.mercurial-scm.org/D7492/new/ REVISION DETAIL https://phab.mercurial-scm.org/D74

Re: D7494: localrepo: fastpath access to "."

2020-01-16 Thread Raphaël Gomès
Note: I sent the rebase of this series on behalf of marmoute as he is unable to access his computer at this time. On 1/16/20 3:26 PM, Alphare (Raphaël Gomès) wrote: Alphare updated this revision to Diff 19362. REPOSITORY rHG Mercurial CHANGES SINCE LAST UPDATE https://phab.mercurial

D7909: rust-filepatterns: add support for `ignore` and `subignore` patterns

2020-01-16 Thread Raphaël Gomès
Alphare added inline comments. Alphare marked 2 inline comments as done. INLINE COMMENTS > kevincox wrote in filepatterns.rs:462 > I would write this as `Some(Ok(match syntax { .. }))` as the last expression > of this map. Then instead of `res.extend()` and `res.push()` you just return > the ve

D7867: rust-hg-path: add useful methods to `HgPath`

2020-01-16 Thread Raphaël Gomès
Alphare added inline comments. INLINE COMMENTS > kevincox wrote in hg_path.rs:169 > I don't think we should have this method. It provides us no way to ensure > that the invariants of this type are upheld. It is slightly more typing but I > think we should recommend converting to a slice, doing

D7908: rust-filepatterns: improve API and robustness for pattern files parsing

2020-01-16 Thread Raphaël Gomès
Alphare added inline comments. Alphare marked an inline comment as done. INLINE COMMENTS > kevincox wrote in filepatterns.rs:220 > It might be clearer to do `bytes.iter().take_while(|b| b == sep).count()` Indeed. Also added a comment to explain the reasoning. > kevincox wrote in filepatterns.rs

D7908: rust-filepatterns: improve API and robustness for pattern files parsing

2020-01-16 Thread Raphaël Gomès
Alphare added inline comments. Alphare marked 2 inline comments as done. INLINE COMMENTS > kevincox wrote in filepatterns.rs:237 > If you think it' is clearer that's fine. But I'm curious where "Rust might > optimize iterators better than for loops" comes from. I did a quick test and > it looks

D7867: rust-hg-path: add useful methods to `HgPath`

2020-01-16 Thread Raphaël Gomès
Alphare updated this revision to Diff 19382. REPOSITORY rHG Mercurial CHANGES SINCE LAST UPDATE https://phab.mercurial-scm.org/D7867?vs=19352&id=19382 BRANCH default CHANGES SINCE LAST ACTION https://phab.mercurial-scm.org/D7867/new/ REVISION DETAIL https://phab.mercurial-scm.org/D78

D7869: rust-dirs-multiset: add `DirsChildrenMultiset`

2020-01-16 Thread Raphaël Gomès
Alphare updated this revision to Diff 19383. REPOSITORY rHG Mercurial CHANGES SINCE LAST UPDATE https://phab.mercurial-scm.org/D7869?vs=19358&id=19383 BRANCH default CHANGES SINCE LAST ACTION https://phab.mercurial-scm.org/D7869/new/ REVISION DETAIL https://phab.mercurial-scm.org/D78

D7908: rust-filepatterns: improve API and robustness for pattern files parsing

2020-01-16 Thread Raphaël Gomès
Alphare updated this revision to Diff 19384. REPOSITORY rHG Mercurial CHANGES SINCE LAST UPDATE https://phab.mercurial-scm.org/D7908?vs=19356&id=19384 BRANCH default CHANGES SINCE LAST ACTION https://phab.mercurial-scm.org/D7908/new/ REVISION DETAIL https://phab.mercurial-scm.org/D79

D7909: rust-filepatterns: add support for `include` and `subinclude` patterns

2020-01-16 Thread Raphaël Gomès
Alphare retitled this revision from "rust-filepatterns: add support for `ignore` and `subignore` patterns" to "rust-filepatterns: add support for `include` and `subinclude` patterns". Alphare marked an inline comment as done. Alphare updated this revision to Diff 19385. REPOSITORY rHG Mercuria

D7910: rust-re2: add wrapper for calling Re2 from Rust

2020-01-16 Thread Raphaël Gomès
nd then investigate +/// how much work would be needed to use `regex`. +mod re2; +pub use re2::Re2; diff --git a/rust/hg-core/src/lib.rs b/rust/hg-core/src/lib.rs --- a/rust/hg-core/src/lib.rs +++ b/rust/hg-core/src/lib.rs @@ -21,6 +21,8 @@ pub mod matchers; pub mod revlog; pub use revlog::*;

D7914: rust-matchers: implement `visit_children_set` for `FileMatcher`

2020-01-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 As per the removed inline comment, this will become useful in a future patch in this series as the `IncludeMatcher` is introduced. REPOSITORY

D7914: rust-matchers: implement `visit_children_set` for `FileMatcher`

2020-01-16 Thread Raphaël Gomès
Alphare updated this revision to Diff 19388. REPOSITORY rHG Mercurial CHANGES SINCE LAST UPDATE https://phab.mercurial-scm.org/D7914?vs=19387&id=19388 BRANCH default CHANGES SINCE LAST ACTION https://phab.mercurial-scm.org/D7914/new/ REVISION DETAIL https://phab.mercurial-scm.org/D79

D7914: rust-matchers: implement `visit_children_set` for `FileMatcher`

2020-01-17 Thread Raphaël Gomès
Alphare added inline comments. INLINE COMMENTS > martinvonz wrote in matchers.rs:166 > This will often be called repeatedly, so isn't it better to calculate a map > of each parent directory to its `VisitChildrenSet` value upfront (in > `FilesMatcher::new()`)? Agreed. In much of this series the

D7923: rust-matchers: add functions to get roots, dirs and parents from patterns

2020-01-17 Thread Raphaël Gomès
Alphare created this revision. Herald added subscribers: mercurial-devel, kevincox, durin42. Herald added a reviewer: hg-reviewers. REVISION SUMMARY These functions will be used to help build the upcoming `IncludeMatcher`. REPOSITORY rHG Mercurial BRANCH default REVISION DETAIL https://

D7922: rust-matchers: add function to generate a regex matcher function

2020-01-17 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 function will be used to help build the upcoming `IncludeMatcher`. While Re2 is still used and behind a feature flag, this function returns

D7921: rust-dirs-multiset: improve temporary error message

2020-01-17 Thread Raphaël Gomès
Alphare created this revision. Herald added subscribers: mercurial-devel, kevincox, durin42. Herald added a reviewer: hg-reviewers. REVISION SUMMARY While we wait on a future patch that could verify that the paths passed to `DirsMultiset` have been audited, we still need to handle this error.

D7924: rust-matchers: add `build_regex_match` function

2020-01-17 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 function will be used to help build the upcoming `IncludeMatcher`. REPOSITORY rHG Mercurial BRANCH default REVISION DETAIL https://ph

D7910: rust-re2: add wrapper for calling Re2 from Rust

2020-01-17 Thread Raphaël Gomès
be needed to use `regex`. +mod re2; +pub use re2::Re2; diff --git a/rust/hg-core/src/lib.rs b/rust/hg-core/src/lib.rs --- a/rust/hg-core/src/lib.rs +++ b/rust/hg-core/src/lib.rs @@ -21,6 +21,8 @@ pub mod matchers; pub mod revlog; pub use revlog::*; +#[cfg(feature = "with-re2")] +pub m

D7925: rust-matchers: add `IgnoreMatcher`

2020-01-17 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 is a big change but all of the pieces call each other, so it makes sense to have this all in one patch. REPOSITORY rHG Mercurial BRANCH

D7926: rust-dependencies: update rayon

2020-01-17 Thread Raphaël Gomès
Alphare created this revision. Herald added a subscriber: mercurial-devel. Herald added a reviewer: hg-reviewers. REPOSITORY rHG Mercurial BRANCH default REVISION DETAIL https://phab.mercurial-scm.org/D7926 AFFECTED FILES rust/Cargo.lock rust/hg-core/Cargo.toml CHANGE DETAILS diff -

D7927: rust-status: add util for listing a directory

2020-01-17 Thread Raphaël Gomès
Alphare created this revision. Herald added subscribers: mercurial-devel, kevincox, durin42. Herald added a reviewer: hg-reviewers. REVISION SUMMARY I debated moving it to utils, but it is not used anywhere else for now, and its skip behavior is pretty specific to status. REPOSITORY rHG Mer

D7928: rust-status: add function for sequential traversal of the working directory

2020-01-17 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 also introduces helper structs to make things clearer. REPOSITORY rHG Mercurial BRANCH default REVISION DETAIL https://phab.me

D7914: rust-matchers: implement `visit_children_set` for `FileMatcher`

2020-01-17 Thread Raphaël Gomès
Alphare added inline comments. INLINE COMMENTS > martinvonz wrote in matchers.rs:166 > Yes, code quality is never urgent. The problem is that there isn't much > incentive for people to clean it up after. So I'd really prefer to not queue > this without the cleanup. I don't feel like this is an

D7923: rust-matchers: add functions to get roots, dirs and parents from patterns

2020-01-17 Thread Raphaël Gomès
Alphare updated this revision to Diff 19418. REPOSITORY rHG Mercurial CHANGES SINCE LAST UPDATE https://phab.mercurial-scm.org/D7923?vs=19402&id=19418 BRANCH default CHANGES SINCE LAST ACTION https://phab.mercurial-scm.org/D7923/new/ REVISION DETAIL https://phab.mercurial-scm.org/D79

D7924: rust-matchers: add `build_regex_match` function

2020-01-17 Thread Raphaël Gomès
Alphare updated this revision to Diff 19419. REPOSITORY rHG Mercurial CHANGES SINCE LAST UPDATE https://phab.mercurial-scm.org/D7924?vs=19403&id=19419 BRANCH default CHANGES SINCE LAST ACTION https://phab.mercurial-scm.org/D7924/new/ REVISION DETAIL https://phab.mercurial-scm.org/D79

D7925: rust-matchers: add `IgnoreMatcher`

2020-01-17 Thread Raphaël Gomès
Alphare updated this revision to Diff 19420. REPOSITORY rHG Mercurial CHANGES SINCE LAST UPDATE https://phab.mercurial-scm.org/D7925?vs=19404&id=19420 BRANCH default CHANGES SINCE LAST ACTION https://phab.mercurial-scm.org/D7925/new/ REVISION DETAIL https://phab.mercurial-scm.org/D79

D7929: rust-status: add bare `hg status` support in hg-core

2020-01-17 Thread Raphaël Gomès
Alphare created this revision. Herald added subscribers: mercurial-devel, kevincox. Herald added a reviewer: hg-reviewers. REVISION SUMMARY A lot of performance remains to be gained, most notably by doing more things in parallel, but also by caching, not falling back to Python but switching

D7930: rust-status: update rust-cpython bridge to account for the changes in core

2020-01-17 Thread Raphaël Gomès
Alphare created this revision. Herald added subscribers: mercurial-devel, kevincox. Herald added a reviewer: hg-reviewers. REPOSITORY rHG Mercurial BRANCH default REVISION DETAIL https://phab.mercurial-scm.org/D7930 AFFECTED FILES rust/hg-cpython/src/dirstate.rs rust/hg-cpython/src/di

D7931: rust-status: use bare hg status fastpath from Python

2020-01-17 Thread Raphaël Gomès
Alphare created this revision. Herald added a subscriber: mercurial-devel. Herald added a reviewer: hg-reviewers. REVISION SUMMARY This change also adds a test case for subrepos. Repeating the benchmark information from the `hg-core` commit: On the Netbeans repository: C: 840ms Rust+C

D7952: rust: add a README

2020-01-21 Thread Raphaël Gomès
Alphare added inline comments. Alphare accepted this revision. INLINE COMMENTS > README.rst:27 > + $ HGWITHRUSTEXT=cpython make tests # to run all tests > + $ (cd tests; HGWITHRUSTEXT=cpython ./run-tests.py) # only the .t > + $ ./hg debuginstall | grep rust # to validate rust is in use I thin

D7952: rust: add a README

2020-01-21 Thread Raphaël Gomès
Alphare added inline comments. INLINE COMMENTS > pulkit wrote in README.rst:25 > IIRC, it's now possible to use `HGMODULEPOLICY=rust`. @gracinet that's > possible now right? `HGMODULEPOLICY=rust+c` to select it at runtime yes. But for not for `make local` AFAIK. REPOSITORY rHG Mercurial CH

D7864: rust-utils: add Rust implementation of Python's "os.path.splitdrive"

2020-01-21 Thread Raphaël Gomès
Closed by commit rHG03aaa328b6b8: rust-utils: add Rust implementation of Python's "os.path.splitdrive" (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/D7864?vs=1

D7868: rust-filepatterns: remove bridge code for filepatterns-related functions

2020-01-21 Thread Raphaël Gomès
Ok(()) }); diff --git a/rust/hg-cpython/src/filepatterns.rs b/rust/hg-cpython/src/filepatterns.rs deleted file mode 100644 --- a/rust/hg-cpython/src/filepatterns.rs +++ /dev/null @@ -1,133 +0,0 @@ -// filepatterns.rs -// -// Copyright 2019, Georges Racinet , -// Raphaël Gomès -// -// Thi

D7791: rust-nodemap: NodeMap trait with simplest implementor

2020-01-21 Thread Raphaël Gomès
Alphare added inline comments. INLINE COMMENTS > martinvonz wrote in nodemap.rs:150 > I find `Deref + Send` hard to understand. I think it would > be helpful to name it. Could we at least define an alias for it? > > Perhaps it's even better to define a trait for it and add named methods on > t

D7791: rust-nodemap: NodeMap trait with simplest implementor

2020-01-22 Thread Raphaël Gomès
Alphare added inline comments. INLINE COMMENTS > martinvonz wrote in nodemap.rs:150 > > Alas, trait aliases are not stable: rust#55628. > > I didn't know about trait aliases, but I think you can already do this: > > trait Thing : Deref + Send {} > > > > > ... since this is a single occurr

D7867: rust-hg-path: add useful methods to `HgPath`

2020-01-24 Thread Raphaël Gomès
Alphare added inline comments. INLINE COMMENTS > martinvonz wrote in hg_path.rs:173 > When do we create such paths? I can imagine using them for referring to > directories. Is that it? If it's some other use-case, I wonder if we can > instead prevent the trailing slash from entering the `HgPath

D7866: rust-pathauditor: add Rust implementation of the `pathauditor`

2020-01-24 Thread Raphaël Gomès
Alphare added inline comments. Alphare marked an inline comment as done. INLINE COMMENTS > martinvonz wrote in path_auditor.rs:55 > As @yuja pointed out on D7864 , it's > weird to have `split_drive()` on `HgPath`, because that is supposed to be a > repo-rel

D7868: rust-filepatterns: remove bridge code for filepatterns-related functions

2020-01-24 Thread Raphaël Gomès
00644 --- a/rust/hg-cpython/src/filepatterns.rs +++ /dev/null @@ -1,133 +0,0 @@ -// filepatterns.rs -// -// Copyright 2019, Georges Racinet , -// 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. - -//! Bin

D7866: rust-pathauditor: add Rust implementation of the `pathauditor`

2020-01-24 Thread Raphaël Gomès
tils/path_auditor.rs new file mode 100644 --- /dev/null +++ b/rust/hg-core/src/utils/path_auditor.rs @@ -0,0 +1,238 @@ +// path_auditor.rs +// +// Copyright 2020 +// Raphaël Gomès , +// +// This software may be used and distributed according to the terms of the +// GNU General Public License version

D7910: rust-re2: add wrapper for calling Re2 from Rust

2020-01-24 Thread Raphaël Gomès
be needed to use `regex`. +mod re2; +pub use re2::Re2; diff --git a/rust/hg-core/src/lib.rs b/rust/hg-core/src/lib.rs --- a/rust/hg-core/src/lib.rs +++ b/rust/hg-core/src/lib.rs @@ -21,6 +21,8 @@ pub mod matchers; pub mod revlog; pub use revlog::*; +#[cfg(feature = "with-re2")] +pub m

D7982: rust-utils: introduce `subslice_index` function

2020-01-24 Thread Raphaël Gomès
Alphare created this revision. Herald added subscribers: mercurial-devel, kevincox. Herald added a reviewer: hg-reviewers. REVISION SUMMARY I implemented it for something that did not turn out to need it, maybe it'll be useful? REPOSITORY rHG Mercurial BRANCH default REVISION DETAIL

D7921: rust-dirs-multiset: improve temporary error message

2020-01-24 Thread Raphaël Gomès
Alphare updated this revision to Diff 19548. REPOSITORY rHG Mercurial CHANGES SINCE LAST UPDATE https://phab.mercurial-scm.org/D7921?vs=19400&id=19548 BRANCH default CHANGES SINCE LAST ACTION https://phab.mercurial-scm.org/D7921/new/ REVISION DETAIL https://phab.mercurial-scm.org/D79

Re: Nlnet funding for transitioning out of SHA-1

2020-01-24 Thread Raphaël Gomès
On 1/16/20 9:38 PM, Augie Fackler wrote: I think overall that looks pretty good. Are you planning on making a submission? Thanks for answer, sorry I took so long to get back to you. It seems like we agree on the broad strokes, so let's go ahead. I am indeed planning on doing the aforementioned

D7867: rust-hg-path: add useful methods to `HgPath`

2020-01-24 Thread Raphaël Gomès
Alphare added inline comments. INLINE COMMENTS > martinvonz wrote in hg_path.rs:173 > Another way of thinking about my question: what happens if we never call this > function? Which tests fail? This is currently this only place it's called (line 189), it was refactored for readability first I

D7982: rust-utils: introduce `subslice_index` function

2020-01-24 Thread Raphaël Gomès
Alphare added a comment. Sure, that is completely fine, I'll remove it from the stack. REPOSITORY rHG Mercurial CHANGES SINCE LAST ACTION https://phab.mercurial-scm.org/D7982/new/ REVISION DETAIL https://phab.mercurial-scm.org/D7982 To: Alphare, #hg-reviewers, martinvonz Cc: martinvon

D7926: rust-dependencies: update rayon

2020-01-24 Thread Raphaël Gomès
Closed by commit rHG161958ebf73c: rust-dependencies: update rayon (authored by Alphare). This revision was automatically updated to reflect the committed changes. CHANGED PRIOR TO COMMIT https://phab.mercurial-scm.org/D7926?vs=19415&id=19557#toc REPOSITORY rHG Mercurial CHANGES SINCE LAST U

Re: Nlnet funding for transitioning out of SHA-1

2020-01-28 Thread Raphaël Gomès
5:53 PM, Raphaël Gomès wrote: Hello all, As you all know, we have to transition out of using SHA-1 for Mercurial (https://www.mercurial-scm.org/wiki/SHA1TransitionPlan). While a known mitigation has been introduced by a few of Augie's patches, we still have to act on that transition.

Re: Nlnet funding for transitioning out of SHA-1

2020-01-29 Thread Raphaël Gomès
I just sent the proposal. I will keep you updated in this thread. Thanks again for helping, Raphaël On 1/28/20 12:46 PM, Raphaël Gomès wrote: Hello again, I think the current proposal is complete, I will re-read the entire thing later tonight to be sure. I plan on submitting tomorrow

Re: [PATCH 1 of 7 RESEND] rust-cpython: remove useless wrappers from PyLeaked, just move by map()

2020-01-29 Thread Raphaël Gomès
I had already reviewed these patches last time, so +1 for me, especially now that the whole ref-sharing stuff has been upstreamed in 0.4 thanks to Yuya. On 1/29/20 12:50 AM, Yuya Nishihara wrote: # HG changeset patch # User Yuya Nishihara # Date 1571711923 -32400 # Tue Oct 22 11:38:43 20

D8047: rust-dirstate: add missing @propertycache

2020-01-30 Thread Raphaël Gomès
Alphare created this revision. Herald added a subscriber: mercurial-devel. Herald added a reviewer: hg-reviewers. REVISION SUMMARY While investigating a regression on `hg update` performance introduced by the Rust `dirstatemap`, two missing `@propertycache` were identified when comparing ag

D8048: rust-dirstatemap: cache non normal and other parent set

2020-01-30 Thread Raphaël Gomès
Alphare created this revision. Herald added subscribers: mercurial-devel, kevincox. Herald added a reviewer: hg-reviewers. REVISION SUMMARY Performance of `hg update` was significantly worse since the introduction of the Rust `dirstatemap`. This regression was noticed by Valentin Gatien-Baron

D8050: rust-dirstatemap: update call sites from Python

2020-01-30 Thread Raphaël Gomès
Alphare created this revision. Herald added a subscriber: mercurial-devel. Herald added a reviewer: hg-reviewers. REPOSITORY rHG Mercurial BRANCH stable REVISION DETAIL https://phab.mercurial-scm.org/D8050 AFFECTED FILES mercurial/dirstate.py CHANGE DETAILS diff --git a/mercurial/dirs

D8049: rust-dirstatemap: add `NonNormalEntries` class

2020-01-30 Thread Raphaël Gomès
/rust/hg-cpython/src/dirstate/non_normal_entries.rs new file mode 100644 --- /dev/null +++ b/rust/hg-cpython/src/dirstate/non_normal_entries.rs @@ -0,0 +1,52 @@ +// non_normal_other_parent_entries.rs +// +// Copyright 2020 Raphaël Gomès +// +// This software may be used and distributed according to

D8047: rust-dirstatemap: add missing @propertycache

2020-02-03 Thread Raphaël Gomès
Closed by commit rHG7f5410dfc8a6: rust-dirstatemap: add missing @propertycache (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 SI

D7866: rust-pathauditor: add Rust implementation of the `pathauditor`

2020-02-06 Thread Raphaël Gomès
Alphare added inline comments. INLINE COMMENTS > martinvonz wrote in path_auditor.rs:86 > Since `HgRepoPath` is a path that's stored in the repo, I don't think so. Oh, > we just want to provide a different error message so we handle that further > up (lines 60-61). I see. What error message do

D7928: rust-status: add function for sequential traversal of the working directory

2020-02-06 Thread Raphaël Gomès
Alphare added a comment. Alphare marked an inline comment as done. In D7928#119428 , @marmoute wrote: > There is a lot going on in this changeset. I am counting at least: > > - new `BadType/BadMatch` structs, > - `StatusResult` → `Dirstat

D7866: rust-pathauditor: add Rust implementation of the `pathauditor`

2020-02-06 Thread Raphaël Gomès
Alphare added inline comments. INLINE COMMENTS > martinvonz wrote in path_auditor.rs:86 > Sorry, I just meant that we do it this way so that we can provide different > error messages for "inside .hg" and "inside subrepo" :) Good idea. I'm rewriting my patches, I will soon send an update for all

D7927: rust-status: add util for listing a directory

2020-02-06 Thread Raphaël Gomès
Alphare added inline comments. Alphare marked an inline comment as done. INLINE COMMENTS > marmoute wrote in status.rs:74 > Silly question: would it make sense to sort the filename before the loop ? It > might result is less bytes to move around since the entry will not be > attached yet. I'm

D7867: rust-hg-path: add useful methods to `HgPath`

2020-02-06 Thread Raphaël Gomès
Alphare added inline comments. INLINE COMMENTS > martinvonz wrote in hg_path.rs:173 > And what happens if you remove it? It only breaks the single rust test I had to check for that particular case. I'll remove it. REPOSITORY rHG Mercurial CHANGES SINCE LAST ACTION https://phab.mercurial-s

D7929: rust-status: add bare `hg status` support in hg-core

2020-02-06 Thread Raphaël Gomès
Alphare added inline comments. INLINE COMMENTS > marmoute wrote in status.rs:29-38 > I am curious about where this changes comes from? did rust-format changed > opinion or did we reached a threshold? I was fixing conflicts and prefer this style. `rustfmt` does not nest already separate imports

D7867: rust-hg-path: add useful methods to `HgPath`

2020-02-06 Thread Raphaël Gomès
Alphare updated this revision to Diff 19935. REPOSITORY rHG Mercurial CHANGES SINCE LAST UPDATE https://phab.mercurial-scm.org/D7867?vs=19382&id=19935 BRANCH default CHANGES SINCE LAST ACTION https://phab.mercurial-scm.org/D7867/new/ REVISION DETAIL https://phab.mercurial-scm.org/D78

D7871: rust-utils: add util for canonical path

2020-02-06 Thread Raphaël Gomès
Alphare updated this revision to Diff 19937. REPOSITORY rHG Mercurial CHANGES SINCE LAST UPDATE https://phab.mercurial-scm.org/D7871?vs=19359&id=19937 BRANCH default CHANGES SINCE LAST ACTION https://phab.mercurial-scm.org/D7871/new/ REVISION DETAIL https://phab.mercurial-scm.org/D78

D7869: rust-dirs-multiset: add `DirsChildrenMultiset`

2020-02-06 Thread Raphaël Gomès
Alphare updated this revision to Diff 19936. REPOSITORY rHG Mercurial CHANGES SINCE LAST UPDATE https://phab.mercurial-scm.org/D7869?vs=19383&id=19936 BRANCH default CHANGES SINCE LAST ACTION https://phab.mercurial-scm.org/D7869/new/ REVISION DETAIL https://phab.mercurial-scm.org/D78

D7866: rust-pathauditor: add Rust implementation of the `pathauditor`

2020-02-06 Thread Raphaël Gomès
tils/path_auditor.rs new file mode 100644 --- /dev/null +++ b/rust/hg-core/src/utils/path_auditor.rs @@ -0,0 +1,230 @@ +// path_auditor.rs +// +// Copyright 2020 +// Raphaël Gomès , +// +// This software may be used and distributed according to the terms of the +// GNU General Public License version

<    1   2   3   4   5   6   7   8   9   10   >