# HG changeset patch # User Sean Farley # Date 1415567728 28800 # Node ID 565f97e71ce3b8f9b4298f4242b8efdccc298e31 # Parent 9f4778027bc21d512300cdef1a627b0cadfd5214 sortdict: add iteritems method Future patches will start using sortdict for log operations where order is important. Adding iteritems removes the headache of having to remember to use items() if the object is a sortdict. diff -r 9f4778027bc2 -r 565f97e71ce3 mercurial/util.py --- a/mercurial/util.py Sat Nov 08 23:13:39 2014 -0800 +++ b/mercurial/util.py Sun Nov 09 13:15:28 2014 -0800 @@ -369,6 +369,9 @@ return self._list def iterkeys(self): return self._list.__iter__() + def iteritems(self): + for k in self._list: + yield k, self[k] class lrucachedict(object): '''cache most recent gets from or sets to this dictionary'''