Fix example account handling in hierarchy druid

Neil Williams linux at
Fri Oct 22 15:42:39 EDT 2004

Hash: SHA1

I've worked out why the merge druid was finding so many collisions. By using
some test code (since removed) to create a simple 
and test_cb which simply counted the number of discrete Account entities. i.e. 
these are real accounts with GUID's, I got:

Prior to running the hierarchy druid, 0 accounts exist
Prior to initialising the Book Merge, 472 accounts exist
druid-merge new code
Prior to the Book Merge Commit, 472 accounts already exist
After the commit, the merge book contains, 472 accounts
In the final target book, 477 accounts exist

This was a run that started with a dummy book that only had two accounts, 
Expense and Childcare. I selected Car Loan from the hierarchy druid and apart 
from these calls, the code is as CVS HEAD. e.g
counter = 0;
g_message("Prior to the Book Merge Commit, %i accounts already exist", 

The number of accounts is zero prior to the hierarchy druid because the first 
count was taken just after the second session had been started.

The fault lay in the example account read that loaded the entire example 
account directory into the gnc_get_current_book. I've created a temporary 
book and the selected accounts are now the only ones to appear in the real 
session book.

This has been tested in a fresh build from CVS HEAD and with both the merge 
druid and File -> New File for the hierarchy druid alone. It didn't show up 
in previous tests because in the rest of the engine, accounts without an 
account group just got ignored, although they would persist until a new file 
was opened or the user quit.

- -- 

Neil Williams
Version: GnuPG v1.2.5 (GNU/Linux)

-------------- next part --------------
A non-text attachment was scrubbed...
Name: Oct-22-04.patch
Type: text/x-diff
Size: 140897 bytes
Desc: not available
Url :

More information about the gnucash-patches mailing list