mirror of
https://github.com/GothenburgBitFactory/taskwarrior.git
synced 2025-08-26 15:47:19 +02:00
Only warn about .data files when showing reports (#3473)
* Only warn about .data files when showing reports This avoids the warning appearing in shell completion, for example. * Update src/commands/CmdCustom.cpp Co-authored-by: ryneeverett <ryneeverett@gmail.com> --------- Co-authored-by: ryneeverett <ryneeverett@gmail.com>
This commit is contained in:
parent
9788798189
commit
24f56b65a9
2 changed files with 10 additions and 8 deletions
|
@ -58,14 +58,6 @@ TDB2::TDB2 ()
|
|||
////////////////////////////////////////////////////////////////////////////////
|
||||
void TDB2::open_replica (const std::string& location, bool create_if_missing)
|
||||
{
|
||||
File pending_data = File (location + "/pending.data");
|
||||
if (pending_data.exists()) {
|
||||
Color warning = Color (Context::getContext ().config.get ("color.warning"));
|
||||
std::cerr << warning.colorize (
|
||||
format ("Found existing '*.data' files in {1}", location)) << "\n";
|
||||
std::cerr << " Taskwarrior's storage format changed in 3.0, requiring a manual migration.\n";
|
||||
std::cerr << " See https://github.com/GothenburgBitFactory/taskwarrior/releases.\n";
|
||||
}
|
||||
replica = tc::Replica(location, create_if_missing);
|
||||
}
|
||||
|
||||
|
|
|
@ -30,6 +30,7 @@
|
|||
#include <sstream>
|
||||
#include <map>
|
||||
#include <vector>
|
||||
#include <iostream>
|
||||
#include <algorithm>
|
||||
#include <stdlib.h>
|
||||
#include <Context.h>
|
||||
|
@ -272,6 +273,15 @@ int CmdCustom::execute (std::string& output)
|
|||
}
|
||||
}
|
||||
|
||||
std::string location = (Context::getContext ().data_dir);
|
||||
File pending_data = File (location + "/pending.data");
|
||||
if (pending_data.exists()) {
|
||||
Color warning = Color (Context::getContext ().config.get ("color.warning"));
|
||||
std::cerr << warning.colorize (
|
||||
format ("Found existing '*.data' files in {1}", location)) << "\n";
|
||||
std::cerr << " Taskwarrior's storage format changed in 3.0, requiring a manual migration.\n";
|
||||
std::cerr << " See https://github.com/GothenburgBitFactory/taskwarrior/releases.\n";
|
||||
}
|
||||
|
||||
feedback_backlog ();
|
||||
output = out.str ();
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue