# HG changeset patch # User Christophe de Vienne # Date 1471623688 -7200 # Node ID 16e0bcd4f8540a17eb402e0e832eeef068cd6bda # Parent d483f003d230a24727741af457ed0fb14f326d08 Switch to the new hg spanset API This api was introduced in 3.2, and the indexation is not supported anymore (probably since 3.4) Patch provided by David Douard (see https://bitbucket.org/sjl/hg-review/pull-requests/8/better-handling-of-obsolescence-markers/diff#comment-8174971) diff -r d483f003d230 -r 16e0bcd4f854 README.markdown --- a/README.markdown Fri Nov 21 17:04:06 2014 +0100 +++ b/README.markdown Fri Aug 19 18:21:28 2016 +0200 @@ -4,7 +4,7 @@ Installing ========== -`hg-review` requires Mercurial 2.3+ and Python 2.5+. It requires a few other +`hg-review` requires Mercurial 3.2+ and Python 2.5+. It requires a few other things too, but they're bundled with the extension so you don't need to worry about them. diff -r d483f003d230 -r 16e0bcd4f854 review/web.py --- a/review/web.py Fri Nov 21 17:04:06 2014 +0100 +++ b/review/web.py Fri Aug 19 18:21:28 2016 +0200 @@ -130,15 +130,15 @@ revs = g.datastore.target.revs('sort(last(:%s, %s), -rev)' % ( rev_max, LOG_PAGE_LEN)) - rev_max, rev_min = revs[0], revs[-1] + rev_max, rev_min = revs.first(), revs.last() - older = g.datastore.target.revs('first(last(:%s, 2))' % rev_min)[0] + older = g.datastore.target.revs('first(last(:%s, 2))' % rev_min).first() if rev_max == tip: newer = -1 else: newer = g.datastore.target.revs('last(first(%s:, %s))' % ( - rev_max, LOG_PAGE_LEN + 1))[0] + rev_max, LOG_PAGE_LEN + 1)).first() rcsets = [g.datastore[r] for r in revs] return _render('index.html', rcsets=rcsets, newer=newer, older=older) @@ -202,10 +202,10 @@ tip = g.datastore.target['tip'].rev() newer = rcset.target[ - rcset.target.revs('sort(first(%s:, 2), -rev)' % rev.rev())[0] + rcset.target.revs('sort(first(%s:, 2), -rev)' % rev.rev()).first() ] if rev.rev() < tip else None older = rcset.target[ - rcset.target.revs('sort(last(:%s, 2), rev)' % rev.rev())[0] + rcset.target.revs('sort(last(:%s, 2), rev)' % rev.rev()).first() ] if rev.rev() > 0 else None return _render('changeset.html', rcset=rcset, rev=rev, cu_signoff=cu_signoff,