Mercurial > hg
changeset 17769:8672e615d81c
histedit: max(x, key=y) and min(x, key=y) are not available in python 2.4
Use sorted(x, key=y)[-1] or sorted(x, key=y)[0] instead.
author | Thomas Arendsen Hein <thomas@intevation.de> |
---|---|
date | Tue, 16 Oct 2012 16:04:28 +0200 |
parents | 9837cafc25b1 |
children | 6c81b8ebf66e |
files | hgext/histedit.py |
diffstat | 1 files changed, 2 insertions(+), 2 deletions(-) [+] |
line wrap: on
line diff
--- a/hgext/histedit.py Sat Oct 13 15:10:39 2012 -0500 +++ b/hgext/histedit.py Tue Oct 16 16:04:28 2012 +0200 @@ -701,14 +701,14 @@ # computed topmost element (necessary for bookmark) if new: - newtopmost = max(new, key=repo.changelog.rev) + newtopmost = sorted(new, key=repo.changelog.rev)[-1] elif not final: # Nothing rewritten at all. we won't need `newtopmost` # It is the same as `oldtopmost` and `processreplacement` know it newtopmost = None else: # every body died. The newtopmost is the parent of the root. - newtopmost = repo[min(final, key=repo.changelog.rev)].p1().node() + newtopmost = repo[sorted(final, key=repo.changelog.rev)[0]].p1().node() return final, tmpnodes, new, newtopmost