Patchwork [STABLE] hgweb: load revcount + 1 entries to fill nextentry in log page (issue5972)

login
register
mail settings
Submitter Yuya Nishihara
Date Aug. 31, 2018, 12:52 p.m.
Message ID <ede3bf31fe63677fdf5b.1535719928@mimosa>
Download mbox | patch
Permalink /patch/34205/
State Accepted
Headers show

Comments

Yuya Nishihara - Aug. 31, 2018, 12:52 p.m.
# HG changeset patch
# User Yuya Nishihara <yuya@tcha.org>
# Date 1535719464 -32400
#      Fri Aug 31 21:44:24 2018 +0900
# Branch stable
# Node ID ede3bf31fe63677fdf5bd8db687977d4e3d792ed
# Parent  d750a6c9248d9dd97de089f7d7e8da7dd99a0ebf
hgweb: load revcount + 1 entries to fill nextentry in log page (issue5972)

"revcount + 1" is moved to the call site to make it clearer.
Anton Shestakov - Sept. 1, 2018, 3:07 a.m.
On Fri, 31 Aug 2018 21:52:08 +0900
Yuya Nishihara <yuya@tcha.org> wrote:

> # HG changeset patch
> # User Yuya Nishihara <yuya@tcha.org>
> # Date 1535719464 -32400
> #      Fri Aug 31 21:44:24 2018 +0900
> # Branch stable
> # Node ID ede3bf31fe63677fdf5bd8db687977d4e3d792ed
> # Parent  d750a6c9248d9dd97de089f7d7e8da7dd99a0ebf
> hgweb: load revcount + 1 entries to fill nextentry in log page (issue5972)

Queued, many thanks!

Patch

diff --git a/mercurial/hgweb/webcommands.py b/mercurial/hgweb/webcommands.py
--- a/mercurial/hgweb/webcommands.py
+++ b/mercurial/hgweb/webcommands.py
@@ -394,12 +394,12 @@  def changelog(web, shortlog=False):
         ctx = web.repo['tip']
         symrev = 'tip'
 
-    def changelist():
+    def changelist(maxcount):
         revs = []
         if pos != -1:
             revs = web.repo.changelog.revs(pos, 0)
 
-        for entry in webutil.changelistentries(web, revs, revcount, parity):
+        for entry in webutil.changelistentries(web, revs, maxcount, parity):
             yield entry
 
     if shortlog:
@@ -426,7 +426,7 @@  def changelog(web, shortlog=False):
 
     changenav = webutil.revnav(web.repo).gen(pos, revcount, count)
 
-    entries = list(changelist())
+    entries = list(changelist(revcount + 1))
     latestentry = entries[:1]
     if len(entries) > revcount:
         nextentry = entries[-1:]