##// END OF EJS Templates
rust-status: expose DifferenceMatcher from Rust to Python
Raphaël Gomès -
r50374:6193e846 default
parent child Browse files
Show More
@@ -1287,6 +1287,7 b' class dirstate:'
1287
1287
1288 allowed_matchers = (
1288 allowed_matchers = (
1289 matchmod.alwaysmatcher,
1289 matchmod.alwaysmatcher,
1290 matchmod.differencematcher,
1290 matchmod.exactmatcher,
1291 matchmod.exactmatcher,
1291 matchmod.includematcher,
1292 matchmod.includematcher,
1292 matchmod.intersectionmatcher,
1293 matchmod.intersectionmatcher,
@@ -15,7 +15,10 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::{IntersectionMatcher, Matcher, NeverMatcher, UnionMatcher};
18 use hg::matchers::{
19 DifferenceMatcher, IntersectionMatcher, Matcher, NeverMatcher,
20 UnionMatcher,
21 };
19 use hg::{
22 use hg::{
20 matchers::{AlwaysMatcher, FileMatcher, IncludeMatcher},
23 matchers::{AlwaysMatcher, FileMatcher, IncludeMatcher},
21 parse_pattern_syntax,
24 parse_pattern_syntax,
@@ -233,6 +236,12 b' fn extract_matcher('
233
236
234 Ok(Box::new(IntersectionMatcher::new(m1, m2)))
237 Ok(Box::new(IntersectionMatcher::new(m1, m2)))
235 }
238 }
239 "differencematcher" => {
240 let m1 = extract_matcher(py, matcher.getattr(py, "_m1")?)?;
241 let m2 = extract_matcher(py, matcher.getattr(py, "_m2")?)?;
242
243 Ok(Box::new(DifferenceMatcher::new(m1, m2)))
244 }
236 e => Err(PyErr::new::<FallbackError, _>(
245 e => Err(PyErr::new::<FallbackError, _>(
237 py,
246 py,
238 format!("Unsupported matcher {}", e),
247 format!("Unsupported matcher {}", e),
General Comments 0
You need to be logged in to leave comments. Login now