Skip to content
Snippets Groups Projects
Commit 0b00998e authored by Raphaël Gomès's avatar Raphaël Gomès
Browse files

rust-dirstate: add `intersectionmatcher` to the allowed matchers

`IntersectionMatcher` is now implemented in Rust.
parent 5e53ecbc
No related branches found
No related tags found
2 merge requests!168branching: merge default into stable,!155Rust Matcher support improvement
...@@ -1247,6 +1247,7 @@ ...@@ -1247,6 +1247,7 @@
matchmod.alwaysmatcher, matchmod.alwaysmatcher,
matchmod.exactmatcher, matchmod.exactmatcher,
matchmod.includematcher, matchmod.includematcher,
matchmod.intersectionmatcher,
matchmod.unionmatcher, matchmod.unionmatcher,
) )
......
...@@ -15,7 +15,7 @@ ...@@ -15,7 +15,7 @@
PyResult, PyTuple, Python, PythonObject, ToPyObject, PyResult, PyTuple, Python, PythonObject, ToPyObject,
}; };
use hg::dirstate::status::StatusPath; use hg::dirstate::status::StatusPath;
use hg::matchers::{Matcher, UnionMatcher}; use hg::matchers::{Matcher, UnionMatcher, IntersectionMatcher};
use hg::{ use hg::{
matchers::{AlwaysMatcher, FileMatcher, IncludeMatcher}, matchers::{AlwaysMatcher, FileMatcher, IncludeMatcher},
parse_pattern_syntax, parse_pattern_syntax,
...@@ -226,6 +226,12 @@ ...@@ -226,6 +226,12 @@
Ok(Box::new(UnionMatcher::new(matchers?))) Ok(Box::new(UnionMatcher::new(matchers?)))
} }
"intersectionmatcher" => {
let m1 = extract_matcher(py, matcher.getattr(py, "_m1")?)?;
let m2 = extract_matcher(py, matcher.getattr(py, "_m2")?)?;
Ok(Box::new(IntersectionMatcher::new(m1, m2)))
}
e => Err(PyErr::new::<FallbackError, _>( e => Err(PyErr::new::<FallbackError, _>(
py, py,
format!("Unsupported matcher {}", e), format!("Unsupported matcher {}", e),
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment