From 6e87e05e151412db2bd1345557306649c8519b6e Mon Sep 17 00:00:00 2001 From: Paul Beckingham Date: Sun, 5 Jul 2009 13:51:30 -0400 Subject: [PATCH] Enhancement - Info report now includes number of undo transactions. --- src/report.cpp | 13 ++++++++++--- 1 file changed, 10 insertions(+), 3 deletions(-) diff --git a/src/report.cpp b/src/report.cpp index bdfb3885c..38f7eabc4 100644 --- a/src/report.cpp +++ b/src/report.cpp @@ -1613,13 +1613,16 @@ std::string handleReportStats () if (!stat (file.c_str (), &s)) dataSize += s.st_size; -#ifdef FEADTURE_UNDO file = location + "/undo.data"; if (!stat (file.c_str (), &s)) dataSize += s.st_size; -#endif - // TODO Include transaction log? + std::vector undo; + slurp (file, undo, false); + int undoCount = 0; + foreach (tx, undo) + if (tx->substr (0, 3) == "---") + ++undoCount; // Get all the tasks. std::vector tasks; @@ -1749,6 +1752,10 @@ std::string handleReportStats () table.addCell (row, 0, "Data size"); table.addCell (row, 1, formatBytes (dataSize)); + row = table.addRow (); + table.addCell (row, 0, "Undo transactions"); + table.addCell (row, 1, undoCount); + if (totalT) { row = table.addRow ();