Merge branch '2.4.3' of ssh://git.tasktools.org/tm/task into 2.4.3
This commit is contained in:
@@ -6,6 +6,8 @@
|
|||||||
- TW-1581 Tasks with dependencies show wrong urgency values for the first
|
- TW-1581 Tasks with dependencies show wrong urgency values for the first
|
||||||
report run after a task in the dependency chain is completed/deleted (thanks
|
report run after a task in the dependency chain is completed/deleted (thanks
|
||||||
to Ulf Eliasson).
|
to Ulf Eliasson).
|
||||||
|
- TW-1583 Invalid ID displayed for first report after done/delete (thanks to
|
||||||
|
Ulf Eliasson).
|
||||||
- Setting 'bulk' to zero is interpreted as infinity, which means there is no
|
- Setting 'bulk' to zero is interpreted as infinity, which means there is no
|
||||||
amount of changes that is considered dangerous (thanks to Tomas Babej).
|
amount of changes that is considered dangerous (thanks to Tomas Babej).
|
||||||
|
|
||||||
|
|||||||
@@ -101,6 +101,7 @@ Context::Context ()
|
|||||||
, dom ()
|
, dom ()
|
||||||
, determine_color_use (true)
|
, determine_color_use (true)
|
||||||
, use_color (true)
|
, use_color (true)
|
||||||
|
, run_gc (true)
|
||||||
, verbosity_legacy (false)
|
, verbosity_legacy (false)
|
||||||
, terminal_width (0)
|
, terminal_width (0)
|
||||||
, terminal_height (0)
|
, terminal_height (0)
|
||||||
@@ -478,7 +479,14 @@ int Context::dispatch (std::string &out)
|
|||||||
// GC is invoked prior to running any command that displays task IDs, if
|
// GC is invoked prior to running any command that displays task IDs, if
|
||||||
// possible.
|
// possible.
|
||||||
if (c->displays_id () && !tdb2.read_only ())
|
if (c->displays_id () && !tdb2.read_only ())
|
||||||
|
{
|
||||||
|
run_gc = true;
|
||||||
tdb2.gc ();
|
tdb2.gc ();
|
||||||
|
}
|
||||||
|
else
|
||||||
|
{
|
||||||
|
run_gc = false;
|
||||||
|
}
|
||||||
|
|
||||||
/*
|
/*
|
||||||
// Only read-only commands can be run when TDB2 is read-only.
|
// Only read-only commands can be run when TDB2 is read-only.
|
||||||
|
|||||||
@@ -94,6 +94,8 @@ public:
|
|||||||
bool determine_color_use;
|
bool determine_color_use;
|
||||||
bool use_color;
|
bool use_color;
|
||||||
|
|
||||||
|
bool run_gc;
|
||||||
|
|
||||||
bool verbosity_legacy;
|
bool verbosity_legacy;
|
||||||
std::vector <std::string> verbosity;
|
std::vector <std::string> verbosity;
|
||||||
std::vector <std::string> headers;
|
std::vector <std::string> headers;
|
||||||
|
|||||||
10
src/TDB2.cpp
10
src/TDB2.cpp
@@ -316,9 +316,15 @@ void TF2::load_tasks ()
|
|||||||
++line_number;
|
++line_number;
|
||||||
Task task (*i);
|
Task task (*i);
|
||||||
|
|
||||||
// Some tasks gets an ID.
|
// Some tasks get an ID.
|
||||||
if (_has_ids)
|
if (_has_ids)
|
||||||
task.id = context.tdb2.next_id ();
|
{
|
||||||
|
Task::status status = task.getStatus ();
|
||||||
|
// Completed / deleted tasks in pending.data get an ID if GC is off.
|
||||||
|
if (!context.run_gc ||
|
||||||
|
(status != Task::completed && status != Task::deleted))
|
||||||
|
task.id = context.tdb2.next_id ();
|
||||||
|
}
|
||||||
|
|
||||||
_tasks.push_back (task);
|
_tasks.push_back (task);
|
||||||
|
|
||||||
|
|||||||
@@ -108,8 +108,10 @@ class TestExportCommand(TestCase):
|
|||||||
def test_export_end(self):
|
def test_export_end(self):
|
||||||
self.t(('1', 'start'))
|
self.t(('1', 'start'))
|
||||||
self.t.faketime("+5s")
|
self.t.faketime("+5s")
|
||||||
self.t(('1', 'done'))
|
# After a task is "done" or "deleted", it does not have an ID by which
|
||||||
self.assertTimestamp(self.export(1)['end'])
|
# to filter it anymore. Add a tag to work around this.
|
||||||
|
self.t(('1', 'done', '+workaround'))
|
||||||
|
self.assertTimestamp(self.export('+workaround')['end'])
|
||||||
|
|
||||||
def test_export_due(self):
|
def test_export_due(self):
|
||||||
self.t(('1', 'modify', 'due:today'))
|
self.t(('1', 'modify', 'due:today'))
|
||||||
|
|||||||
Reference in New Issue
Block a user