# HG changeset patch # User domruf # Date 1499606456 -7200 # Node ID b39b9bb4a754b1dfa0cfb91670eb6f07556fb518 # Parent 8b265e5f9e07aa47c9a1201c4705bc576938e3ae hg: fix next() and prev() for obsolete changesets If using evolve, the revision number is not longer the same as the (visible) number of changesets. When you clicked the next or prev button on the files page, simply nothing happened. At the first click the files list got reloaded, but after that nothing happened. diff -r 8b265e5f9e07 -r b39b9bb4a754 kallithea/lib/vcs/backends/hg/changeset.py --- a/kallithea/lib/vcs/backends/hg/changeset.py Thu Jun 29 21:41:03 2017 +0200 +++ b/kallithea/lib/vcs/backends/hg/changeset.py Sun Jul 09 15:20:56 2017 +0200 @@ -172,7 +172,7 @@ cs = self while True: try: - next_ = cs.revision + 1 + next_ = cs.repository.revisions.index(cs.raw_id) + 1 next_rev = cs.repository.revisions[next_] except IndexError: raise ChangesetDoesNotExistError @@ -189,7 +189,7 @@ cs = self while True: try: - prev_ = cs.revision - 1 + prev_ = cs.repository.revisions.index(cs.raw_id) - 1 if prev_ < 0: raise IndexError prev_rev = cs.repository.revisions[prev_]