Mercurial > public > mercurial-scm > hg-stable
diff mercurial/util.py @ 9155:b46063eabe98
util: wrap at termwidth-2 by default
author | Martin Geisler <mg@lazybytes.net> |
---|---|
date | Thu, 16 Jul 2009 23:25:25 +0200 |
parents | 54eb3782d32f |
children | 570416319ed3 |
line wrap: on
line diff
--- a/mercurial/util.py Wed Jul 15 17:44:47 2009 +0200 +++ b/mercurial/util.py Thu Jul 16 23:25:25 2009 +0200 @@ -1272,7 +1272,9 @@ pass return 80 -def wrap(line, hangindent, width=78): +def wrap(line, hangindent, width=None): + if width is None: + width = termwidth() - 2 padding = '\n' + ' ' * hangindent return padding.join(textwrap.wrap(line, width=width - hangindent))