Enhancement

- Info report now includes number of undo transactions.
This commit is contained in:
Paul Beckingham 2009-07-05 13:51:30 -04:00
parent fbeadfa313
commit 6e87e05e15

View file

@ -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 ();