From 499aed0bd34b19ec445b78ca8f368e3c130d32b0 Mon Sep 17 00:00:00 2001 From: Don Allingham Date: Mon, 28 Nov 2005 02:55:35 +0000 Subject: [PATCH] * src/MergeData.py: fix dangling family after a merge. svn: r5443 --- gramps2/ChangeLog | 3 +++ gramps2/configure.in | 3 ++- gramps2/src/MergePeople.py | 16 ++++++++++++++-- gramps2/src/plugins/Check.py | 1 + 4 files changed, 20 insertions(+), 3 deletions(-) diff --git a/gramps2/ChangeLog b/gramps2/ChangeLog index 454c4cb19..b1bf91176 100644 --- a/gramps2/ChangeLog +++ b/gramps2/ChangeLog @@ -1,3 +1,6 @@ +2005-11-27 Don Allingham + * src/MergeData.py: fix dangling family after a merge. + 2005-11-27 Alex Roitman * src/po/template.po: Update. diff --git a/gramps2/configure.in b/gramps2/configure.in index 47147183a..6d64a4c36 100644 --- a/gramps2/configure.in +++ b/gramps2/configure.in @@ -7,8 +7,9 @@ AC_PREREQ(2.57) AC_INIT(gramps, 2.0.9, gramps-bugs@lists.sourceforge.net) AC_CONFIG_SRCDIR(src/gramps.py) AM_INIT_AUTOMAKE(1.6.3) -RELEASE=0.CVS$(head -c 10 ${srcdir}/ChangeLog | tr -d '-') +dnl RELEASE=0.CVS$(head -c 10 ${srcdir}/ChangeLog | tr -d '-') dnl RELEASE=1 +RELEASE=0.RC1 VERSIONSTRING=$VERSION if test x"$RELEASE" != "x" diff --git a/gramps2/src/MergePeople.py b/gramps2/src/MergePeople.py index 82556bf16..562253f1e 100644 --- a/gramps2/src/MergePeople.py +++ b/gramps2/src/MergePeople.py @@ -167,8 +167,8 @@ class Compare: self.add(tobj,indent,"%s:\t%s" % (_('Type'),relstr)) event = ReportUtils.find_marriage(self.db,family) if event: - self.add(tobj,indent,"%s:\t%s" % (_('Marriage'), - self.get_event_info(event.get_handle()))) + self.add(tobj,indent,"%s:\t%s" % ( + _('Marriage'), self.get_event_info(event.get_handle()))) for child_id in family.get_child_handle_list(): child = self.db.get_person_from_handle(child_id) self.add(tobj,indent,"%s:\t%s" % (_('Child'),name_of(child))) @@ -354,7 +354,11 @@ class MergePeople: trans = self.db.transaction_begin() self.merge_person_information(new,trans) + self.debug_person(new, "NEW") + self.merge_family_information(new,trans) + self.debug_person(new, "NEW") + self.db.commit_person(new,trans) self.debug_person(new, "NEW") self.db.remove_person(self.old_handle,trans) @@ -537,6 +541,7 @@ class MergePeople: """ self.merge_parents(new, trans) self.merge_relationships(new, trans) + self.debug_person(new, "NEW") def merge_parents(self, new, trans): """ @@ -557,6 +562,8 @@ class MergePeople: for fid in self.p2.get_parent_family_handle_list(): if fid not in parent_list: parent_list.append(fid) + if __debug__: + print "Adding family to parent list", fid # loop through the combined list, converting the child handles # of the families, and adding the families to the merged @@ -599,6 +606,7 @@ class MergePeople: family_num = 0 family_list = self.p1.get_family_handle_list() + new.set_family_handle_list(family_list) for src_handle in self.p2.get_family_handle_list(): @@ -635,6 +643,8 @@ class MergePeople: for fid in self.p1.get_family_handle_list(): if fid not in new.get_family_handle_list(): new.add_family_handle(fid) + if __debug__: + print "Adding family %s" % fid if src_handle in new.get_family_handle_list(): continue @@ -749,6 +759,8 @@ class MergePeople: if child_handle != self.new_handle: child = self.db.get_person_from_handle(child_handle) if child.remove_parent_family_handle(src_family_handle): + if __debug__: + print "Remove parent family %s from %s" % (src_family_handle,child_handle) self.db.commit_person(child,trans) # delete the old source family diff --git a/gramps2/src/plugins/Check.py b/gramps2/src/plugins/Check.py index 5d1334bd0..8841e2db1 100644 --- a/gramps2/src/plugins/Check.py +++ b/gramps2/src/plugins/Check.py @@ -769,6 +769,7 @@ class CheckIntegrity: if efam == 1: self.text.write(_("1 empty family was found\n")) + self.text.write("\t%s\n" % self.empty_family[0]) elif efam > 1: self.text.write(_("%d empty families were found\n") % efam) if rel == 1: