mercurial/templatefilters.py
changeset 19228 889807c79384
parent 19227 8eef5b93db9d
child 19467 1afe5d3939db
--- a/mercurial/templatefilters.py	Wed Apr 10 18:56:38 2013 -0500
+++ b/mercurial/templatefilters.py	Thu Apr 18 15:48:22 2013 -0500
@@ -99,8 +99,8 @@
 para_re = None
 space_re = None
 
-def fill(text, width):
-    '''fill many paragraphs.'''
+def fill(text, width, initindent = '', hangindent = ''):
+    '''fill many paragraphs with optional indentation.'''
     global para_re, space_re
     if para_re is None:
         para_re = re.compile('(\n\n|\n\\s*[-*]\\s*)', re.M)
@@ -121,7 +121,8 @@
             yield text[start:m.start(0)], m.group(1)
             start = m.end(1)
 
-    return "".join([space_re.sub(' ', util.wrap(para, width=width)) + rest
+    return "".join([util.wrap(space_re.sub(' ', util.wrap(para, width)),
+                              width, initindent, hangindent) + rest
                     for para, rest in findparas()])
 
 def fill68(text):