hgweb: replace next(revs) to revs.next() to fix compatibility with Python 2.5-

--HG--
branch : stable
mq: rename next() to nextpatch() to avoid confusing a future check-code patch

next() is a builtin starting in 2.6, so it's also nice to avoid
shadowing the builtin.

--HG--
branch : stable
extra : rebase_source : 5d4abd5df1608b4550dbe02aff8e2b7bb0b15ed6
check-code: add a check for the next() builtin, which was new in 2.6

--HG--
branch : stable
extra : rebase_source : 9f89b84f378143e2adb9f02f93200fdc5191f663