##// END OF EJS Templates
rust-dirstate: add `unionmatcher` to the allowed matchers...
Raphaël Gomès -
r50244:0043c7aa 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.unionmatcher,
1250 )
1251 )
1251
1252
1252 if rustmod is None:
1253 if rustmod is None:
@@ -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;
18 use hg::matchers::{Matcher, UnionMatcher};
19 use hg::{
19 use hg::{
20 matchers::{AlwaysMatcher, FileMatcher, IncludeMatcher},
20 matchers::{AlwaysMatcher, FileMatcher, IncludeMatcher},
21 parse_pattern_syntax,
21 parse_pattern_syntax,
@@ -217,6 +217,15 b' fn extract_matcher('
217
217
218 Ok(Box::new(matcher))
218 Ok(Box::new(matcher))
219 }
219 }
220 "unionmatcher" => {
221 let matchers: PyResult<Vec<_>> = matcher
222 .getattr(py, "_matchers")?
223 .iter(py)?
224 .map(|py_matcher| extract_matcher(py, py_matcher?))
225 .collect();
226
227 Ok(Box::new(UnionMatcher::new(matchers?)))
228 }
220 e => Err(PyErr::new::<FallbackError, _>(
229 e => Err(PyErr::new::<FallbackError, _>(
221 py,
230 py,
222 format!("Unsupported matcher {}", e),
231 format!("Unsupported matcher {}", e),
General Comments 0
You need to be logged in to leave comments. Login now