Patchwork [06,of,20] hgweb: add latestentry and oldestentry for search

login
register
mail settings
Submitter Alexander Plavin
Date Aug. 9, 2013, 6:57 p.m.
Message ID <8bd7e833e3be398d1932.1376074651@debian-alexander.dolgopa>
Download mbox | patch
Permalink /patch/2110/
State Changes Requested
Headers show

Comments

Alexander Plavin - Aug. 9, 2013, 6:57 p.m.
# HG changeset patch
# User Alexander Plavin <alexander@plav.in>
# Date 1376045683 -14400
#      Fri Aug 09 14:54:43 2013 +0400
# Node ID 8bd7e833e3be398d1932bb51b3bfa462531414b2
# Parent  b8d1a5f78bb48a8377ed60ea863fa74717114922
hgweb: add latestentry and oldestentry for search

These arguments are given to template for search view, same as already done
in changelog.

Patch

diff -r b8d1a5f78bb4 -r 8bd7e833e3be mercurial/hgweb/webcommands.py
--- a/mercurial/hgweb/webcommands.py	Fri Aug 09 14:54:31 2013 +0400
+++ b/mercurial/hgweb/webcommands.py	Fri Aug 09 14:54:43 2013 +0400
@@ -245,9 +245,12 @@ 
     parity = paritygen(web.stripecount)
 
     entries = list(changelist())
+    latestentry = entries[:1]
+    oldestentry = entries[-1:]
 
     return tmpl('search', query=query, node=tip.hex(),
                 entries=entries, archives=web.archivelist("tip"),
+                latestentry=latestentry, oldestentry=oldestentry,
                 morevars=morevars, lessvars=lessvars,
                 modedesc=searchfunc[1],
                 showforcekw=showforcekw, showunforcekw=showunforcekw)