mirror of
https://github.com/GothenburgBitFactory/taskwarrior.git
synced 2025-09-02 03:37:19 +02:00
Feedback
- Corrected algorithm for detecting task differences. It was mis- reporting removed attributes as both deleted and changed.
This commit is contained in:
parent
fc9f9980b8
commit
c33d67949b
1 changed files with 8 additions and 1 deletions
|
@ -26,6 +26,7 @@
|
||||||
////////////////////////////////////////////////////////////////////////////////
|
////////////////////////////////////////////////////////////////////////////////
|
||||||
|
|
||||||
#include <iostream>
|
#include <iostream>
|
||||||
|
#include <algorithm>
|
||||||
#include <sstream>
|
#include <sstream>
|
||||||
#include <vector>
|
#include <vector>
|
||||||
#include <string>
|
#include <string>
|
||||||
|
@ -120,8 +121,13 @@ std::string taskDifferences (const Task& before, const Task& after)
|
||||||
}
|
}
|
||||||
|
|
||||||
for (name = beforeAtts.begin (); name != beforeAtts.end (); ++name)
|
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" &&
|
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")
|
if (*name == "depends")
|
||||||
{
|
{
|
||||||
|
@ -152,6 +158,7 @@ std::string taskDifferences (const Task& before, const Task& after)
|
||||||
<< renderAttribute (*name, after.get (*name))
|
<< renderAttribute (*name, after.get (*name))
|
||||||
<< "'.\n";
|
<< "'.\n";
|
||||||
}
|
}
|
||||||
|
}
|
||||||
|
|
||||||
// Shouldn't just say nothing.
|
// Shouldn't just say nothing.
|
||||||
if (out.str ().length () == 0)
|
if (out.str ().length () == 0)
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue