]> arthur.barton.de Git - bup.git/commit
git.packwriter: explicitly manage lifetimes
authorRob Browning <rlb@defaultvalue.org>
Sat, 23 Oct 2021 17:59:06 +0000 (12:59 -0500)
committerRob Browning <rlb@defaultvalue.org>
Mon, 22 Nov 2021 06:33:50 +0000 (00:33 -0600)
commit53b57e5fcb1980d49c22d1fd53d992cee3b2797a
treecc517acd5017cf1c82fc8dcdd80c8563e1e681ae
parent16c5650034c907d7ee1fa9a2e2dc0292b71b1016
git.packwriter: explicitly manage lifetimes

Explicitly close all packwriters, instead of relying on __del__.  Use
"with ..." context management in most cases..  This is in preparation
for removing __del__.

Rework _end to handle *all* cleanup and to ensure that we always
release the relevant resources, whether closing normally, or aborting.
This means that we only have two places to consider with respect to
resource management: __init__ and _end.

Signed-off-by: Rob Browning <rlb@defaultvalue.org>
Tested-by: Rob Browning <rlb@defaultvalue.org>
lib/bup/client.py
lib/bup/cmd/save.py
lib/bup/cmd/server.py
lib/bup/cmd/split.py
lib/bup/gc.py
lib/bup/git.py
lib/bup/helpers.py
lib/bup/rm.py
test/int/test_client.py
test/int/test_git.py