Mercurial > hg
diff mercurial/util.py @ 12698:7aef77e74cf3
util: make wrap() require a width argument
This keeps hgweb's help engine from poking at file descriptors that
don't exist.
author | Matt Mackall <mpm@selenic.com> |
---|---|
date | Sun, 10 Oct 2010 18:02:52 -0500 |
parents | c52c629ce19e |
children | 551aa6e27929 |
line wrap: on
line diff
--- a/mercurial/util.py Sat Oct 09 16:55:33 2010 -0500 +++ b/mercurial/util.py Sun Oct 10 18:02:52 2010 -0500 @@ -1313,9 +1313,7 @@ #### naming convention of above implementation follows 'textwrap' module -def wrap(line, width=None, initindent='', hangindent=''): - if width is None: - width = termwidth() - 2 +def wrap(line, width, initindent='', hangindent=''): maxindent = max(len(hangindent), len(initindent)) if width <= maxindent: # adjust for weird terminal size