Mercurial > public > mercurial-scm > hg
diff mercurial/dirstate.py @ 6762:f67d1468ac50
util: add sort helper
author | Matt Mackall <mpm@selenic.com> |
---|---|
date | Fri, 27 Jun 2008 18:28:45 -0500 |
parents | d56ceb82cddb |
children | 80605a8127e0 |
line wrap: on
line diff
--- a/mercurial/dirstate.py Fri Jun 27 14:53:30 2008 -0500 +++ b/mercurial/dirstate.py Fri Jun 27 18:28:45 2008 -0500 @@ -153,9 +153,7 @@ return key in self._map def __iter__(self): - a = self._map.keys() - a.sort() - for x in a: + for x in util.sort(self._map): yield x def parents(self): @@ -436,8 +434,7 @@ if not unknown: return ret - b = self._map.keys() - b.sort() + b = util.sort(self._map) blen = len(b) for x in unknown: @@ -578,12 +575,10 @@ add((nn, 'f', st)) elif np in dc: add((nn, 'm', st)) - found.sort() - return found + return util.sort(found) # step one, find all files that match our criteria - files.sort() - for ff in files: + for ff in util.sort(files): nf = normpath(ff) nn = self.normalize(nf) f = _join(ff) @@ -617,9 +612,7 @@ # step two run through anything left in the dc hash and yield # if we haven't already seen it - ks = dc.keys() - ks.sort() - for k in ks: + for k in util.sort(dc): if k in known: continue known[k] = 1