diff options
author | Lars Wirzenius <liw@liw.fi> | 2017-06-11 21:47:34 +0300 |
---|---|---|
committer | Lars Wirzenius <liw@liw.fi> | 2017-06-11 21:47:34 +0300 |
commit | 64407f758296e752d0db41866d3509e3b499d377 (patch) | |
tree | 83e971c42d4b67cb24b1d847692ccba473a97aed | |
parent | 05b9e1ec29c85cf6258be5114742d15277bbb550 (diff) | |
download | obnam-64407f758296e752d0db41866d3509e3b499d377.tar.gz |
Fix: don't remove in-use chunks
-rw-r--r-- | obnamlib/fmt_ga/indexes.py | 2 | ||||
-rwxr-xr-x | test-ga-forget | 4 |
2 files changed, 3 insertions, 3 deletions
diff --git a/obnamlib/fmt_ga/indexes.py b/obnamlib/fmt_ga/indexes.py index 8931617f..2ca76bd7 100644 --- a/obnamlib/fmt_ga/indexes.py +++ b/obnamlib/fmt_ga/indexes.py @@ -198,7 +198,7 @@ class GAChunkIndexes(object): chunk_store, unused_chunks) for bag_id in maybe_unused_bags: chunk_ids = chunk_store.get_chunks_in_bag(bag_id) - if self.any_chunk_is_used_by_someone(chunk_ids): + if not self.any_chunk_is_used_by_someone(chunk_ids): chunk_store.remove_bag(bag_id) def get_unused_chunks(self): diff --git a/test-ga-forget b/test-ga-forget index 1f2e12b3..5c0a5a17 100755 --- a/test-ga-forget +++ b/test-ga-forget @@ -13,7 +13,7 @@ obnam() } rm -rf t.data t.repo t.log -genbackupdata --create 100M t.data +genbackupdata --create 1G t.data obnam backup genid="$(obnam genids)" obnam forget "$genid" @@ -25,7 +25,7 @@ echo -n "Generations: " obnam genids | tr '\n' ' ' echo -if [ "$size" -gt 1 ] +if [ "$size" -gt 10 ] then echo "FORGET DIDN'T REMOVE DATA" 1>&2 exit 1 |