diff rhodecode/lib/helpers.py @ 2028:ef3114b01c7c beta

fixed issues when urlify commit created empty links when link_ param was empty
author Marcin Kuzminski <marcin@python-works.com>
date Fri, 24 Feb 2012 20:53:11 +0200
parents 8ccac2b0fcf3
children 82a88013a3fd 8ecfed1d8f8b
line wrap: on
line diff
--- a/rhodecode/lib/helpers.py	Thu Feb 23 04:04:00 2012 +0200
+++ b/rhodecode/lib/helpers.py	Fri Feb 24 20:53:11 2012 +0200
@@ -827,6 +827,15 @@
 
 
 def urlify_commit(text_, repository=None, link_=None):
+    """
+    Parses given text message and makes proper links.
+    issues are linked to given issue-server, and rest is a changeset link
+    if link_ is given, in other case it's a plain text
+
+    :param text_:
+    :param repository:
+    :param link_: changeset link
+    """
     import re
     import traceback
 
@@ -878,8 +887,9 @@
 
             newtext = URL_PAT.sub(url_func, text_)
 
-            # wrap not links into final link => link_
-            newtext = linkify_others(newtext, link_)
+            if link_:
+                # wrap not links into final link => link_
+                newtext = linkify_others(newtext, link_)
 
             return literal(newtext)
     except: