comparison mercurial/localrepo.py @ 12919:0071c8fc2fa6

localrepo: make heads use the keyword args of the sorted builtin
author Ronny Pfannschmidt <Ronny.Pfannschmidt@gmx.de>
date Tue, 02 Nov 2010 11:25:52 +0100
parents fabe61418a53
children cc4e13c92dfa
comparison
equal deleted inserted replaced
12918:5c3e5cd141ea 12919:0071c8fc2fa6
1200 return r 1200 return r
1201 1201
1202 def heads(self, start=None): 1202 def heads(self, start=None):
1203 heads = self.changelog.heads(start) 1203 heads = self.changelog.heads(start)
1204 # sort the output in rev descending order 1204 # sort the output in rev descending order
1205 heads = [(-self.changelog.rev(h), h) for h in heads] 1205 return sorted(heads, key=self.changelog.rev, reverse=True)
1206 return [n for (r, n) in sorted(heads)]
1207 1206
1208 def branchheads(self, branch=None, start=None, closed=False): 1207 def branchheads(self, branch=None, start=None, closed=False):
1209 '''return a (possibly filtered) list of heads for the given branch 1208 '''return a (possibly filtered) list of heads for the given branch
1210 1209
1211 Heads are returned in topological order, from newest to oldest. 1210 Heads are returned in topological order, from newest to oldest.