summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorLars Wirzenius <liw@liw.fi>2017-06-11 21:47:34 +0300
committerLars Wirzenius <liw@liw.fi>2017-06-11 21:47:34 +0300
commit64407f758296e752d0db41866d3509e3b499d377 (patch)
tree83e971c42d4b67cb24b1d847692ccba473a97aed
parent05b9e1ec29c85cf6258be5114742d15277bbb550 (diff)
downloadobnam-64407f758296e752d0db41866d3509e3b499d377.tar.gz
Fix: don't remove in-use chunks
-rw-r--r--obnamlib/fmt_ga/indexes.py2
-rwxr-xr-xtest-ga-forget4
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