mirror of
https://github.com/GothenburgBitFactory/taskwarrior.git
synced 2025-08-28 13:37:20 +02:00
Dependencies
- Added TDB::gc code to remove dangling dependencies.
This commit is contained in:
parent
cade134f40
commit
b050d67ba9
3 changed files with 38 additions and 9 deletions
24
src/Task.cpp
24
src/Task.cpp
|
@ -495,16 +495,8 @@ void Task::addDependency (int id)
|
|||
}
|
||||
|
||||
////////////////////////////////////////////////////////////////////////////////
|
||||
void Task::removeDependency (int id)
|
||||
void Task::removeDependency (const std::string& uuid)
|
||||
{
|
||||
std::string uuid = context.tdb.uuid (id);
|
||||
if (uuid == "")
|
||||
{
|
||||
std::stringstream s;
|
||||
s << "Could not find a UUID for id " << id << ".";
|
||||
throw s.str ();
|
||||
}
|
||||
|
||||
std::vector <std::string> deps;
|
||||
split (deps, get ("depends"), ',');
|
||||
|
||||
|
@ -519,6 +511,20 @@ void Task::removeDependency (int id)
|
|||
}
|
||||
}
|
||||
|
||||
////////////////////////////////////////////////////////////////////////////////
|
||||
void Task::removeDependency (int id)
|
||||
{
|
||||
std::string uuid = context.tdb.uuid (id);
|
||||
if (uuid != "")
|
||||
removeDependency (uuid);
|
||||
else
|
||||
{
|
||||
std::stringstream s;
|
||||
s << "Could not find a UUID for id " << id << ".";
|
||||
throw s.str ();
|
||||
}
|
||||
}
|
||||
|
||||
////////////////////////////////////////////////////////////////////////////////
|
||||
void Task::getDependencies (std::vector <int>& all) const
|
||||
{
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue