changeset 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 63cfacb7917e
children c9c7e8cdac9c
files mercurial/util.py
diffstat 1 files changed, 3 insertions(+), 1 deletions(-) [+]
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))