Skip to content
Snippets Groups Projects
Commit 8cfa3a36 authored by Alexander Plavin's avatar Alexander Plavin
Browse files

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.
parent 002b711a
No related branches found
No related tags found
No related merge requests found
......@@ -875,11 +875,9 @@
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 = []
......@@ -880,11 +878,17 @@
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))
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment