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

Alexander Plavin alexander at plav.in
Fri Aug 9 13:57:31 CDT 2013


# HG changeset patch
# User Alexander Plavin <alexander at 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.

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)


More information about the Mercurial-devel mailing list