# HG changeset patch # User Alexander Plavin # Date 1374705682 -14400 # Node ID 8cfa3a3664a5b9c5ec561df81516c1b19e690c7d # Parent 002b711a3e8af864b2a284b057320a777b4ee147 hgweb: fix incorrect revisions count in graph (issue3977) Actual amount of revisions is used now instead of their numbers in the repo before to deal with skipped numbers correctly. diff -r 002b711a3e8a -r 8cfa3a3664a5 mercurial/hgweb/webcommands.py --- a/mercurial/hgweb/webcommands.py Thu Jul 25 02:22:39 2013 +0400 +++ b/mercurial/hgweb/webcommands.py Thu Jul 25 02:41:22 2013 +0400 @@ -875,16 +875,20 @@ count = len(web.repo) pos = rev - start = max(0, pos - revcount + 1) - end = pos + 1 uprev = min(max(0, count - 1), rev + revcount) downrev = max(0, rev - revcount) changenav = webutil.revnav(web.repo).gen(pos, revcount, count) tree = [] - if start < end: - revs = list(web.repo.changelog.revs(end - 1, start)) + if pos != -1: + allrevs = web.repo.changelog.revs(pos, 0) + revs = [] + for i in allrevs: + revs.append(i) + if len(revs) >= revcount: + break + dag = graphmod.dagwalker(web.repo, revs) tree = list(graphmod.colored(dag, web.repo))