Changeset - b39b9bb4a754
[Not reviewed]
default
0 1 0
domruf - 8 years ago 2017-07-09 15:20:56
dominikruf@gmail.com
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.
1 file changed with 2 insertions and 2 deletions:
0 comments (0 inline, 0 general)
kallithea/lib/vcs/backends/hg/changeset.py
Show inline comments
 
@@ -172,7 +172,7 @@ class MercurialChangeset(BaseChangeset):
 
        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 @@ class MercurialChangeset(BaseChangeset):
 
        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_]
0 comments (0 inline, 0 general)