[PATCH] trim author and description on gitweb summary page

TK Soh teekaysoh at yahoo.com
Fri Jun 2 12:08:40 CDT 2006


--- TK Soh <teekaysoh at gmail.com> wrote:
> The trimming code has been adapted from original gitweb's CGI [perl]
> script, and it looks a bit mysterious to me - without a tiny bit of
> comment of the part of code. So, the filter names I used may not
> reflect the true maximum length of the trimmed text.

This one does some adjustment to make it look closer to the original gitweb. Though
I have a feeling that it's going to change again ;-)

# HG changeset patch
# User TK Soh <teekaysoh at yahoo.com>
# Date 1149267916 18000
# Node ID 1f87d1c70bfeab47e57f0f53a74c60ecffddd3eb
# Parent  f7000016573a3fbe484193d3724666538b3218d5
gitweb: adjust trim settings on summary page

diff -r f7000016573a -r 1f87d1c70bfe mercurial/templater.py
--- a/mercurial/templater.py	Fri Jun 02 10:28:59 2006 -0500
+++ b/mercurial/templater.py	Fri Jun 02 12:05:16 2006 -0500
@@ -298,8 +298,8 @@ common_filters = {
     "shortdate": shortdate,
     "stringify": stringify,
     "strip": lambda x: x.strip(),
-    "trim20": lambda x: trim(x, 15, 5),
-    "trim60": lambda x: trim(x, 50, 10),
+    "trim20": lambda x: trim(x, 10, 10),
+    "trim60": lambda x: trim(x, 55, 5),
     "urlescape": lambda x: urllib.quote(x),
     "user": lambda x: util.shortuser(x),
     }


__________________________________________________
Do You Yahoo!?
Tired of spam?  Yahoo! Mail has the best spam protection around 
http://mail.yahoo.com 


More information about the Mercurial mailing list