sortdict: add insert method
Future patches will allow extensions to choose which order a namespace should
output in the log, so we add a way for sortdict to insert to a specific
location.
--- a/mercurial/util.py Sun Nov 09 13:15:28 2014 -0800
+++ b/mercurial/util.py Wed Oct 15 12:39:19 2014 -0700
@@ -372,6 +372,9 @@
def iteritems(self):
for k in self._list:
yield k, self[k]
+ def insert(self, index, key, val):
+ self._list.insert(index, key)
+ dict.__setitem__(self, key, val)
class lrucachedict(object):
'''cache most recent gets from or sets to this dictionary'''