# HG changeset patch # User Sean Farley # Date 1413401959 25200 # Node ID 79858e66a7cec5c2273a53fe42c65a248e979211 # Parent 565f97e71ce3b8f9b4298f4242b8efdccc298e31 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. diff -r 565f97e71ce3 -r 79858e66a7ce mercurial/util.py --- 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'''