summaryrefslogtreecommitdiff
path: root/devel/monotone/patches
diff options
context:
space:
mode:
authordan <dan@pkgsrc.org>2006-09-22 11:14:05 +0000
committerdan <dan@pkgsrc.org>2006-09-22 11:14:05 +0000
commitab0530311a436f62bed53fd3c36daf35182bf84d (patch)
treec77191c3f62b04dc7f377e2953e5685c3b56aa2a /devel/monotone/patches
parent119d8ee846d8df5c105515e6e2cbb30a34c591ea (diff)
downloadpkgsrc-ab0530311a436f62bed53fd3c36daf35182bf84d.tar.gz
Fix a regression introduced between 0.29 and 0.30 detected when
handling large repositories like NetBSD src. Problem found by riz@, fix from mainline a:njs/d:2006-09-22T07:01:26, tested by me. bump rev to nb1 ChangeLog: 2006-09-21 Nathaniel Smith <njs@pobox.com> * lru_writeback_cache.hh (clean_insert): Correct the cache overflow logic so as to _actually_ never remove the last element. Add an invariant to verify this. (insert_dirty): Add an invariant here too.
Diffstat (limited to 'devel/monotone/patches')
-rw-r--r--devel/monotone/patches/patch-ab32
1 files changed, 32 insertions, 0 deletions
diff --git a/devel/monotone/patches/patch-ab b/devel/monotone/patches/patch-ab
new file mode 100644
index 00000000000..1ec72321ec3
--- /dev/null
+++ b/devel/monotone/patches/patch-ab
@@ -0,0 +1,32 @@
+$NetBSD: patch-ab,v 1.3 2006/09/22 11:14:06 dan Exp $
+
+--- lru_writeback_cache.hh 4ac60f38211fc4ef11ee1f968bfb88fee5446937
++++ lru_writeback_cache.hh c2fa384b9b29d6c5162fad70ebe96e6479b8aa3e
+@@ -212,19 +212,24 @@ public:
+ {
+ // Remove the last element.
+ liter = _list.end();
+- // Unless it's the only element (i.e., the one we just inserted) -- we
+- // never empty ourselves out completely
++ I(liter != _list.begin());
++ --liter;
++ // liter now points to the last element. If the last element is also
++ // the first element -- i.e., the list has only one element, and we
++ // know that it's the one we just inserted -- then never mind, we
++ // never want to empty ourselves out completely.
+ if (liter == _list.begin())
+ break;
+- --liter;
+ this->_remove(liter->first);
+ }
++ I(exists(key));
+ }
+
+ inline void insert_dirty(Key const & key, const Data & data)
+ {
+ insert_clean(key, data);
+ safe_insert(_dirty, key);
++ I(is_dirty(key));
+ }
+
+ private: