mirror of
https://github.com/GothenburgBitFactory/taskwarrior.git
synced 2025-08-21 07:43:08 +02:00
Enhancement
- Info report now includes number of undo transactions.
This commit is contained in:
parent
fbeadfa313
commit
6e87e05e15
1 changed files with 10 additions and 3 deletions
|
@ -1613,13 +1613,16 @@ std::string handleReportStats ()
|
||||||
if (!stat (file.c_str (), &s))
|
if (!stat (file.c_str (), &s))
|
||||||
dataSize += s.st_size;
|
dataSize += s.st_size;
|
||||||
|
|
||||||
#ifdef FEADTURE_UNDO
|
|
||||||
file = location + "/undo.data";
|
file = location + "/undo.data";
|
||||||
if (!stat (file.c_str (), &s))
|
if (!stat (file.c_str (), &s))
|
||||||
dataSize += s.st_size;
|
dataSize += s.st_size;
|
||||||
#endif
|
|
||||||
|
|
||||||
// TODO Include transaction log?
|
std::vector <std::string> undo;
|
||||||
|
slurp (file, undo, false);
|
||||||
|
int undoCount = 0;
|
||||||
|
foreach (tx, undo)
|
||||||
|
if (tx->substr (0, 3) == "---")
|
||||||
|
++undoCount;
|
||||||
|
|
||||||
// Get all the tasks.
|
// Get all the tasks.
|
||||||
std::vector <Task> tasks;
|
std::vector <Task> tasks;
|
||||||
|
@ -1749,6 +1752,10 @@ std::string handleReportStats ()
|
||||||
table.addCell (row, 0, "Data size");
|
table.addCell (row, 0, "Data size");
|
||||||
table.addCell (row, 1, formatBytes (dataSize));
|
table.addCell (row, 1, formatBytes (dataSize));
|
||||||
|
|
||||||
|
row = table.addRow ();
|
||||||
|
table.addCell (row, 0, "Undo transactions");
|
||||||
|
table.addCell (row, 1, undoCount);
|
||||||
|
|
||||||
if (totalT)
|
if (totalT)
|
||||||
{
|
{
|
||||||
row = table.addRow ();
|
row = table.addRow ();
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue