diff -r 94e91205d9b6 -r 0bf0045000b5 mercurial/merge.py --- a/mercurial/merge.py Tue May 12 10:03:36 2009 -0400 +++ b/mercurial/merge.py Wed May 13 14:08:39 2009 +0200 @@ -263,16 +263,8 @@ return action -def actioncmp(a1, a2): - m1 = a1[1] - m2 = a2[1] - if m1 == m2: - return cmp(a1, a2) - if m1 == 'r': - return -1 - if m2 == 'r': - return 1 - return cmp(a1, a2) +def actionkey(a): + return a[1] == 'r' and -1 or 0, a def applyupdates(repo, action, wctx, mctx): "apply the merge action list to the working directory" @@ -281,7 +273,7 @@ ms = mergestate(repo) ms.reset(wctx.parents()[0].node()) moves = [] - action.sort(actioncmp) + action.sort(key=actionkey) # prescan for merges for a in action: