--- a/mercurial/dirstate.py Wed Jul 06 11:44:20 2022 +0200
+++ b/mercurial/dirstate.py Wed Jul 06 11:46:00 2022 +0200
@@ -1287,6 +1287,7 @@
allowed_matchers = (
matchmod.alwaysmatcher,
+ matchmod.differencematcher,
matchmod.exactmatcher,
matchmod.includematcher,
matchmod.intersectionmatcher,
--- a/rust/hg-cpython/src/dirstate/status.rs Wed Jul 06 11:44:20 2022 +0200
+++ b/rust/hg-cpython/src/dirstate/status.rs Wed Jul 06 11:46:00 2022 +0200
@@ -15,7 +15,10 @@
PyResult, PyTuple, Python, PythonObject, ToPyObject,
};
use hg::dirstate::status::StatusPath;
-use hg::matchers::{IntersectionMatcher, Matcher, NeverMatcher, UnionMatcher};
+use hg::matchers::{
+ DifferenceMatcher, IntersectionMatcher, Matcher, NeverMatcher,
+ UnionMatcher,
+};
use hg::{
matchers::{AlwaysMatcher, FileMatcher, IncludeMatcher},
parse_pattern_syntax,
@@ -233,6 +236,12 @@
Ok(Box::new(IntersectionMatcher::new(m1, m2)))
}
+ "differencematcher" => {
+ let m1 = extract_matcher(py, matcher.getattr(py, "_m1")?)?;
+ let m2 = extract_matcher(py, matcher.getattr(py, "_m2")?)?;
+
+ Ok(Box::new(DifferenceMatcher::new(m1, m2)))
+ }
e => Err(PyErr::new::<FallbackError, _>(
py,
format!("Unsupported matcher {}", e),