changeset 6747:b39b9bb4a754

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.
author domruf <dominikruf@gmail.com>
date Sun, 09 Jul 2017 15:20:56 +0200
parents 8b265e5f9e07
children 29e9cb56f26f
files kallithea/lib/vcs/backends/hg/changeset.py
diffstat 1 files changed, 2 insertions(+), 2 deletions(-) [+]
line wrap: on
line diff
--- 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_]