# HG changeset patch # User Martin von Zweigbergk # Date 2018-07-20 18:17:33 # Node ID 83a505b5cf85ab172e30dedf4d940070f027f1eb # Parent 65ed2fcb9032ae3822fbaf5aac50d8feb0f35cbf revlog: don't include trailing nullrev in revlog.revs(stop=len(revlog)) This was an odd side effect of the nullid entry that's in the index. The existing callers (mostly repair.py) seem to have handled it fine. It doesn't seem intentional, and it's pretty surprising, so let's remove that surprise. Differential Revision: https://phab.mercurial-scm.org/D4015 diff --git a/mercurial/revlog.py b/mercurial/revlog.py --- a/mercurial/revlog.py +++ b/mercurial/revlog.py @@ -1070,12 +1070,15 @@ class revlog(object): def revs(self, start=0, stop=None): """iterate over all rev in this revlog (from start to stop)""" step = 1 + length = len(self) if stop is not None: if start > stop: step = -1 stop += step + if stop > length: + stop = length else: - stop = len(self) + stop = length return xrange(start, stop, step) @util.propertycache