summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorLars Wirzenius <liw@liw.fi>2017-06-11 19:25:25 +0300
committerLars Wirzenius <liw@liw.fi>2017-06-11 19:25:25 +0300
commitd7dc7d8c80769db9bacc4a108ffd1957fa69b69c (patch)
treec4afc19789385365792cbc2d36c9bf361893070e
parent754537b055681199865a77796c6c44d4077cf136 (diff)
downloadobnam-d7dc7d8c80769db9bacc4a108ffd1957fa69b69c.tar.gz
Add: method to check if any chunk in a bag is still in use
-rw-r--r--obnamlib/fmt_ga/indexes.py6
1 files changed, 6 insertions, 0 deletions
diff --git a/obnamlib/fmt_ga/indexes.py b/obnamlib/fmt_ga/indexes.py
index ac22cb61..16f3e5d7 100644
--- a/obnamlib/fmt_ga/indexes.py
+++ b/obnamlib/fmt_ga/indexes.py
@@ -212,5 +212,11 @@ class GAChunkIndexes(object):
chunk_store.get_bag_id(chunk_id)
)
+ def bag_is_used(self, chunk_ids):
+ return any(
+ self.is_chunk_used_by_anyone(chunk_id)
+ for chunk_id in chunk_ids
+ )
+
def validate_chunk_content(self, chunk_id):
return None