From b2a2c996ad935e87b1f28eb77d12a895986073af Mon Sep 17 00:00:00 2001 From: Joey Hess Date: Fri, 24 May 2013 21:33:54 -0400 Subject: Fix bug in parsing of parens in some preferred content expressions. This fixes the behavior of the manual mode group. The current manual mode preferred content expression is: "present and (((exclude=*/archive/* and exclude=archive/*) or (not (copies=archive:1 or copies=smallarchive:1))) or (not copies=semitrusted+:1))" The old matcher misparsed this, to basically: OR (present and (...)) (not copies=semitrusted+:1)) The paren handling and indeed the whole conversion from tokens to the matcher was just wrong. The new way may not be the cleverest, but I think it is correct, and you can see how it pattern matches structurally against the expressions when parsing them. That expression is now parsed to: MAnd (MOp ) (MOr (MOr (MAnd (MOp ) (MOp )) (MNot (MOr (MOp ) (MOp )))) (MNot (MOp ))) Which appears correct, and behaves correct in testing. Also threw in a simplifier, so the final generated Matcher has less unnecessary clutter in it. Mostly so that I could more easily read & confirm them. Also, added a simple test of the Matcher to the test suite. There is a small chance of badly formed preferred content expressions behaving differently than before due to this rewrite. --- debian/changelog | 2 ++ 1 file changed, 2 insertions(+) (limited to 'debian') diff --git a/debian/changelog b/debian/changelog index a7d1aa0fb..5bec3f555 100644 --- a/debian/changelog +++ b/debian/changelog @@ -9,6 +9,8 @@ git-annex (4.20130522) UNRELEASED; urgency=low * hook special remote: Added combined hook program support. * Android app: Avoid using hard links to app's lib directory, which is sometimes on a different filesystem than the data directory. + * Fix bug in parsing of parens in some preferred content expressions. + This fixes the behavior of the manual mode group. -- Joey Hess Tue, 21 May 2013 18:22:46 -0400 -- cgit v1.2.3