Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Only warn about .data files when showing reports #3473

Merged
merged 2 commits into from
Jun 19, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
8 changes: 0 additions & 8 deletions src/TDB2.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -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);
}

Expand Down
10 changes: 10 additions & 0 deletions src/commands/CmdCustom.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -30,6 +30,7 @@
#include <sstream>
#include <map>
#include <vector>
#include <iostream>
#include <algorithm>
#include <stdlib.h>
#include <Context.h>
Expand Down Expand Up @@ -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 ();
Expand Down
Loading