From c33d67949b84886daf66a703dd326b4a46338770 Mon Sep 17 00:00:00 2001 From: Paul Beckingham Date: Sun, 16 Oct 2011 11:20:28 -0400 Subject: [PATCH] Feedback - Corrected algorithm for detecting task differences. It was mis- reporting removed attributes as both deleted and changed. --- src/feedback.cpp | 9 ++++++++- 1 file changed, 8 insertions(+), 1 deletion(-) diff --git a/src/feedback.cpp b/src/feedback.cpp index f35f36a45..d84ddf0e7 100644 --- a/src/feedback.cpp +++ b/src/feedback.cpp @@ -26,6 +26,7 @@ //////////////////////////////////////////////////////////////////////////////// #include +#include #include #include #include @@ -120,8 +121,13 @@ std::string taskDifferences (const Task& before, const Task& after) } for (name = beforeAtts.begin (); name != beforeAtts.end (); ++name) + { + // Ignore UUID differences, and find values that changed, but are not also + // in the beforeOnly and afterOnly lists, which have been handled above.. if (*name != "uuid" && - before.get (*name) != after.get (*name)) + before.get (*name) != after.get (*name) && + std::find (beforeOnly.begin (), beforeOnly.end (), *name) == beforeOnly.end () && + std::find (afterOnly.begin (), afterOnly.end (), *name) == afterOnly.end ()) { if (*name == "depends") { @@ -152,6 +158,7 @@ std::string taskDifferences (const Task& before, const Task& after) << renderAttribute (*name, after.get (*name)) << "'.\n"; } + } // Shouldn't just say nothing. if (out.str ().length () == 0)