##// END OF EJS Templates
manifest: switch add() to heapq.merge (available in Py2.6+)
timeless@mozdev.org -
r26199:5411059d default
parent child Browse files
Show More
@@ -9,6 +9,7 b' from i18n import _'
9 import mdiff, parsers, error, revlog, util
9 import mdiff, parsers, error, revlog, util
10 import array, struct
10 import array, struct
11 import os
11 import os
12 import heapq
12
13
13 propertycache = util.propertycache
14 propertycache = util.propertycache
14
15
@@ -970,12 +971,9 b' class manifest(revlog.revlog):'
970 # revlog layer.
971 # revlog layer.
971
972
972 _checkforbidden(added)
973 _checkforbidden(added)
973 # combine the changed lists into one list for sorting
974 # combine the changed lists into one sorted iterator
974 work = [(x, False) for x in added]
975 work = heapq.merge([(x, False) for x in added],
975 work.extend((x, True) for x in removed)
976 [(x, True) for x in removed])
976 # this could use heapq.merge() (from Python 2.6+) or equivalent
977 # since the lists are already sorted
978 work.sort()
979
977
980 arraytext, deltatext = m.fastdelta(self._mancache[p1][1], work)
978 arraytext, deltatext = m.fastdelta(self._mancache[p1][1], work)
981 cachedelta = self.rev(p1), deltatext
979 cachedelta = self.rev(p1), deltatext
General Comments 0
You need to be logged in to leave comments. Login now