This function will be used to help build the upcoming IncludeMatcher. While
Re2 is still used and behind a feature flag, this function returns an error
meant for fallback in the default case.
Details
- Reviewers
pulkit martinvonz durin42 - Group Reviewers
hg-reviewers - Commits
- rHG52d40f8fb82d: rust-matchers: add function to generate a regex matcher function
Diff Detail
- Repository
- rHG Mercurial
- Branch
- default
- Lint
No Linters Available - Unit
No Unit Test Coverage
Event Timeline
rust/hg-core/src/matchers.rs | ||
---|---|---|
224 | Hmm, I don't like to replicate this into Rust. I argued for a long time with Boris over a year ago that we should see if we can remove it from Python. He said they (Octobus, I think) would look into that if I would just queue the workaround for the time being. Could you see if you can simplify the Python code first instead? See https://patchwork.mercurial-scm.org/patch/36755/ for discussion. |
rust/hg-core/src/matchers.rs | ||
---|---|---|
224 | I am having a little trouble reading the patchwork thread, but I gather that you want to get rid of the preventive splitting of patterns and just let the regex engine handle it on its own? Was this measure taken because of a bug in Python's re or because its exceptions were too coarse/unusable? |
rust/hg-core/src/matchers.rs | ||
---|---|---|
224 | I've looked into the behavior of Re2. It will return an error if the DFA runs out of memory, which seems perfectly reasonable. |
I think this looks good, but I want Martin to ack that his concern is adequately resolved.
Yes, looks good to me now. Thanks.
rust/hg-core/src/matchers.rs | ||
---|---|---|
224 | Thanks for fixing the Rust side. |
@martinvonz this (and next few patches) seems accepted by you and Augie. Should I go ahead and push it or I missed some discussion on IRC about it?
You can push it. I wanted to finish the cleanup to the regex grouping that I mentioned earlier, but that can be done separately. But that's the only reason I haven't queued this patch anyway.
You mean cleanup on the Python side or on the rust side? IIUC, the rust side is fine now.
Hmm, I don't like to replicate this into Rust. I argued for a long time with Boris over a year ago that we should see if we can remove it from Python. He said they (Octobus, I think) would look into that if I would just queue the workaround for the time being. Could you see if you can simplify the Python code first instead?
See https://patchwork.mercurial-scm.org/patch/36755/ for discussion.