util: properly implement lrucachedict.get()
Before, it was returning the raw _lrucachenode instance instead of its
value.
--- a/mercurial/util.py Wed Aug 17 13:25:13 2016 -0700
+++ b/mercurial/util.py Mon Aug 22 20:30:37 2016 -0700
@@ -651,7 +651,7 @@
def get(self, k, default=None):
try:
- return self._cache[k]
+ return self._cache[k].value
except KeyError:
return default
--- a/tests/test-lrucachedict.py Wed Aug 17 13:25:13 2016 -0700
+++ b/tests/test-lrucachedict.py Mon Aug 22 20:30:37 2016 -0700
@@ -25,6 +25,9 @@
d['e'] = 've'
printifpresent(d, ['a', 'b', 'c', 'd', 'e'])
+ assert d.get('a') is None
+ assert d.get('e') == 've'
+
# touch entries in some order (get or set).
d['e']
d['c'] = 'vc2'