##// END OF EJS Templates
rust-dirstate: add `intersectionmatcher` to the allowed matchers...
Raphaël Gomès -
r50246:0b00998e default
parent child Browse files
Show More
@@ -1247,6 +1247,7 b' class dirstate:'
1247 matchmod.alwaysmatcher,
1247 matchmod.alwaysmatcher,
1248 matchmod.exactmatcher,
1248 matchmod.exactmatcher,
1249 matchmod.includematcher,
1249 matchmod.includematcher,
1250 matchmod.intersectionmatcher,
1250 matchmod.unionmatcher,
1251 matchmod.unionmatcher,
1251 )
1252 )
1252
1253
@@ -15,7 +15,7 b' use cpython::{'
15 PyResult, PyTuple, Python, PythonObject, ToPyObject,
15 PyResult, PyTuple, Python, PythonObject, ToPyObject,
16 };
16 };
17 use hg::dirstate::status::StatusPath;
17 use hg::dirstate::status::StatusPath;
18 use hg::matchers::{Matcher, UnionMatcher};
18 use hg::matchers::{Matcher, UnionMatcher, IntersectionMatcher};
19 use hg::{
19 use hg::{
20 matchers::{AlwaysMatcher, FileMatcher, IncludeMatcher},
20 matchers::{AlwaysMatcher, FileMatcher, IncludeMatcher},
21 parse_pattern_syntax,
21 parse_pattern_syntax,
@@ -226,6 +226,12 b' fn extract_matcher('
226
226
227 Ok(Box::new(UnionMatcher::new(matchers?)))
227 Ok(Box::new(UnionMatcher::new(matchers?)))
228 }
228 }
229 "intersectionmatcher" => {
230 let m1 = extract_matcher(py, matcher.getattr(py, "_m1")?)?;
231 let m2 = extract_matcher(py, matcher.getattr(py, "_m2")?)?;
232
233 Ok(Box::new(IntersectionMatcher::new(m1, m2)))
234 }
229 e => Err(PyErr::new::<FallbackError, _>(
235 e => Err(PyErr::new::<FallbackError, _>(
230 py,
236 py,
231 format!("Unsupported matcher {}", e),
237 format!("Unsupported matcher {}", e),
General Comments 0
You need to be logged in to leave comments. Login now