Mercurial > hg
diff mercurial/revset.py @ 32798:573b792872c1
revset: fix order of last() n members where n > 1 (BC)
last() is implemented using a reversed iterator, so the result should be
reversed again.
I've marked this as BC since it's quite old bug seen in 3.0. The first bad
revision is 4849f574aa24 "revset: changed last implementation to use lazy
classes."
author | Yuya Nishihara <yuya@tcha.org> |
---|---|
date | Sat, 10 Jun 2017 18:04:56 +0900 |
parents | f75d0aa5dc83 |
children | b36ec65ea583 |
line wrap: on
line diff
--- a/mercurial/revset.py Sat Jun 10 20:14:23 2017 +0900 +++ b/mercurial/revset.py Sat Jun 10 18:04:56 2017 +0900 @@ -1202,7 +1202,8 @@ break elif y in subset: result.append(y) - return baseset(result, datarepr=('<last n=%d, %r, %r>', lim, subset, os)) + return baseset(result[::-1], datarepr=('<last n=%d, %r, %r>', + lim, subset, os)) @predicate('max(set)', safe=True) def maxrev(repo, subset, x):