Diagnostics
- The 'diagnostics' command now checks for duplicate UUID values in the data.
This commit is contained in:
@@ -43,6 +43,7 @@
|
|||||||
+ Improved text wrapping of UTF8 text.
|
+ Improved text wrapping of UTF8 text.
|
||||||
+ When duplicating a parent recurring task, a new recurring parent task is
|
+ When duplicating a parent recurring task, a new recurring parent task is
|
||||||
created. When a child recurring task is duplicated, a plain task is created.
|
created. When a child recurring task is duplicated, a plain task is created.
|
||||||
|
+ The 'diagnostics' command now checks for duplicate UUID values in the data.
|
||||||
|
|
||||||
# Tracked Features, sorted by ID.
|
# Tracked Features, sorted by ID.
|
||||||
+ Added feature #52, which provides improved text-wrapping support for UTF-8
|
+ Added feature #52, which provides improved text-wrapping support for UTF-8
|
||||||
|
|||||||
@@ -309,6 +309,37 @@ int CmdDiagnostics::execute (std::string& output)
|
|||||||
<< "x"
|
<< "x"
|
||||||
<< context.getHeight ()
|
<< context.getHeight ()
|
||||||
<< ")\n";
|
<< ")\n";
|
||||||
|
|
||||||
|
// Scan tasks for duplicate UUIDs.
|
||||||
|
std::vector <Task> all = context.tdb2.all_tasks ();
|
||||||
|
std::map <std::string, int> seen;
|
||||||
|
std::vector <std::string> dups;
|
||||||
|
std::string uuid;
|
||||||
|
std::vector <Task>::iterator i;
|
||||||
|
for (i = all.begin (); i != all.end (); ++i)
|
||||||
|
{
|
||||||
|
uuid = i->get ("uuid");
|
||||||
|
if (seen.find (uuid) != seen.end ())
|
||||||
|
dups.push_back (uuid);
|
||||||
|
else
|
||||||
|
seen[uuid] = 0;
|
||||||
|
}
|
||||||
|
|
||||||
|
out << " Dups: "
|
||||||
|
<< format (STRING_CMD_DIAG_UUID_SCAN, all.size ())
|
||||||
|
<< "\n";
|
||||||
|
|
||||||
|
if (dups.size ())
|
||||||
|
{
|
||||||
|
std::vector <std::string>::iterator d;
|
||||||
|
for (d = dups.begin (); d != dups.end (); ++d)
|
||||||
|
out << " " << format (STRING_CMD_DIAG_UUID_DUP, *d) << "\n";
|
||||||
|
}
|
||||||
|
else
|
||||||
|
{
|
||||||
|
out << " " << STRING_CMD_DIAG_UUID_NO_DUP
|
||||||
|
<< "\n";
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
out << "\n";
|
out << "\n";
|
||||||
|
|||||||
@@ -407,6 +407,9 @@
|
|||||||
#define STRING_CMD_DIAG_TESTS "Tests"
|
#define STRING_CMD_DIAG_TESTS "Tests"
|
||||||
#define STRING_CMD_DIAG_UUID_GOOD "1000 unique UUIDs generated."
|
#define STRING_CMD_DIAG_UUID_GOOD "1000 unique UUIDs generated."
|
||||||
#define STRING_CMD_DIAG_UUID_BAD "Failed - duplicate UUID at iteration {1}"
|
#define STRING_CMD_DIAG_UUID_BAD "Failed - duplicate UUID at iteration {1}"
|
||||||
|
#define STRING_CMD_DIAG_UUID_SCAN "Scanned {1} tasks for duplicate UUIDs:"
|
||||||
|
#define STRING_CMD_DIAG_UUID_DUP "Found duplicate {1}"
|
||||||
|
#define STRING_CMD_DIAG_UUID_NO_DUP "No duplicates found"
|
||||||
#define STRING_CMD_DIAG_NONE "-none-"
|
#define STRING_CMD_DIAG_NONE "-none-"
|
||||||
#define STRING_CMD_PUSH_USAGE "Pushes the local files to the URL"
|
#define STRING_CMD_PUSH_USAGE "Pushes the local files to the URL"
|
||||||
#define STRING_CMD_PUSH_SAME "Cannot push files when the source and destination are the same."
|
#define STRING_CMD_PUSH_SAME "Cannot push files when the source and destination are the same."
|
||||||
|
|||||||
Reference in New Issue
Block a user