4198: Person view does not remove a row correctly when two people are merged.
This is a major patch by Michael Nauta. It means all writes happen immediately to bsddb, and the bsddb rollback is used on a crash. Transaction is no longer used to store changes and do them on commit. Undo database is set on end. At the same time with statement is used throughout for transactions At the same time, the original bug in merge code should be fixed Still some issues, that will be ironed out svn: r16523
This commit is contained in:
src
Merge
mergeevent.pymergefamily.pymergemedia.pymergenote.pymergeperson.pymergeplace.pymergerepository.pymergesource.py
Reorder.pygen
gui
editors
plugins
@ -305,19 +305,17 @@ class BasePersonView(ListView):
|
||||
self.uistate.set_busy_cursor(True)
|
||||
|
||||
# create the transaction
|
||||
trans = self.dbstate.db.transaction_begin()
|
||||
with self.dbstate.db.transaction_begin() as trans:
|
||||
|
||||
# create name to save
|
||||
person = self.active_person
|
||||
active_name = _("Delete Person (%s)") % name_displayer.display(person)
|
||||
# create name to save
|
||||
person = self.active_person
|
||||
active_name = _("Delete Person (%s)") % name_displayer.display(person)
|
||||
|
||||
# delete the person from the database
|
||||
# Above will emit person-delete, which removes the person via
|
||||
# callback to the model, so row delete is signaled
|
||||
self.dbstate.db.delete_person_from_database(person, trans)
|
||||
|
||||
# commit the transaction
|
||||
self.dbstate.db.transaction_commit(trans, active_name)
|
||||
# delete the person from the database
|
||||
# Above will emit person-delete, which removes the person via
|
||||
# callback to the model, so row delete is signaled
|
||||
self.dbstate.db.delete_person_from_database(person, trans)
|
||||
trans.set_description(active_name)
|
||||
|
||||
self.uistate.set_busy_cursor(False)
|
||||
|
||||
|
Reference in New Issue
Block a user