localrepo: make heads use the keyword args of the sorted builtin
authorRonny Pfannschmidt <Ronny.Pfannschmidt@gmx.de>
Tue, 02 Nov 2010 11:25:52 +0100
changeset 12919 0071c8fc2fa6
parent 12918 5c3e5cd141ea
child 12920 1fab4970354e
localrepo: make heads use the keyword args of the sorted builtin
mercurial/localrepo.py
--- a/mercurial/localrepo.py	Thu Nov 04 11:33:57 2010 -0500
+++ b/mercurial/localrepo.py	Tue Nov 02 11:25:52 2010 +0100
@@ -1202,8 +1202,7 @@
     def heads(self, start=None):
         heads = self.changelog.heads(start)
         # sort the output in rev descending order
-        heads = [(-self.changelog.rev(h), h) for h in heads]
-        return [n for (r, n) in sorted(heads)]
+        return  sorted(heads, key=self.changelog.rev, reverse=True)
 
     def branchheads(self, branch=None, start=None, closed=False):
         '''return a (possibly filtered) list of heads for the given branch