Re: [viewvc-dev] [PATCH] Fix issue #407

Senthil Kumaran S <[email protected]> Thu, 22 Oct 2009 13:11:00 +0530
Newsgroups gmane.comp.version-control.cvs.viewcvs.devel
Organization CollabNet Software Pvt. Ltd
Message-ID <4AE00C8C.9090003__44943.0210669108$1256197285$gmane$org@collab.net>
Hi Mike,

C. Michael Pilato wrote:
> ViewVC already has a regular expression for identifying URLs (the
> perhaps-not-ideally-named _re_rewrite_url).  Along those lines, I wonder if

I missed it.

> a better approach would be to slam the property values through an
> HtmlFormatter class instance (perhaps by using format_log()) so that URLs
> and email addresses (and issue ids, for folks that have customized ViewVC to
> recognize those) are all marked up in the same way that log messages are.
> Thoughts?

Yes 'format_log' will be a better approach. Attaching an updated patch with the
same.

Thank You.
-- 
Senthil Kumaran S
http://www.stylesen.org/

------------------------------------------------------
http://viewvc.tigris.org/ds/viewMessage.do?dsForumId=4251&dsMessageId=2410101

To unsubscribe from this discussion, e-mail: [[email protected]].
fix_issue407_take1.patch (text/x-diff, 809 B)
[[[
Fix issue #407.

* lib/viewvc.py
  (get_itemprops): Use 'format_log' to create links for svn:externals
   values.

Patch by: Senthil Kumaran S <[email protected]>
]]]

Index: lib/viewvc.py
===================================================================
--- lib/viewvc.py	(revision 2274)
+++ lib/viewvc.py	(working copy)
@@ -1618,13 +1618,14 @@
   return string.join(map(lambda x: x.name, items), ', ')
 
 def get_itemprops(request, path_parts, rev):
+  cfg = request.cfg
   itemprops = request.repos.itemprops(path_parts, rev)
   propnames = itemprops.keys()
   propnames.sort()
   props = []
   has_binary_props = 0
   for name in propnames:
-    value = itemprops[name]
+    value = format_log(itemprops[name], cfg)
     undisplayable = ezt.boolean(0)
     # skip non-utf8 property names
     try: