summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorowsla <owsla@2b77aa54-bcbc-44c9-a7ec-4f6cf2b41109>2008-07-30 00:58:35 +0000
committerowsla <owsla@2b77aa54-bcbc-44c9-a7ec-4f6cf2b41109>2008-07-30 00:58:35 +0000
commitd8b9224f4617c11d720418c22db03a9236e50549 (patch)
tree7f04260a5f08a085cccc5e7068690a40dfeaa46a
parent64e8f1ffc0fe1b5863e2d20ddb5b9599291d236f (diff)
downloadrdiff-backup-d8b9224f4617c11d720418c22db03a9236e50549.tar.gz
Don't crash if a CacheIndexable tries to clear a non-existent cache entry.
git-svn-id: http://svn.savannah.nongnu.org/svn/rdiff-backup/trunk@921 2b77aa54-bcbc-44c9-a7ec-4f6cf2b41109
-rw-r--r--rdiff-backup/CHANGELOG7
-rw-r--r--rdiff-backup/rdiff_backup/rorpiter.py8
2 files changed, 13 insertions, 2 deletions
diff --git a/rdiff-backup/CHANGELOG b/rdiff-backup/CHANGELOG
index feed2a3..fdfebc6 100644
--- a/rdiff-backup/CHANGELOG
+++ b/rdiff-backup/CHANGELOG
@@ -1,3 +1,10 @@
+New in v1.2.1 (????/??/??)
+---------------------------
+
+Don't crash if a CacheIndexable tries to clear a non-existent cache entry,
+since the entry must already be cleared. (Andrew Ferguson)
+
+
New in v1.2.0 (2008/07/27)
---------------------------
diff --git a/rdiff-backup/rdiff_backup/rorpiter.py b/rdiff-backup/rdiff_backup/rorpiter.py
index aec3f32..8fa9446 100644
--- a/rdiff-backup/rdiff_backup/rorpiter.py
+++ b/rdiff-backup/rdiff_backup/rorpiter.py
@@ -344,8 +344,12 @@ class CacheIndexable:
self.cache_dict[next_index] = next_elem
self.cache_indicies.append(next_index)
- if len(self.cache_indicies) > self.cache_size:
- del self.cache_dict[self.cache_indicies[0]]
+ if len(self.cache_indicies) > self.cache_size:
+ try:
+ del self.cache_dict[self.cache_indicies[0]]
+ except KeyError:
+ log.Log("Warning: index %s missing from iterator cache" %
+ (first_index,),2)
del self.cache_indicies[0]
return next_elem