util: wrap at termwidth-2 by default
authorMartin Geisler <mg@lazybytes.net>
Thu, 16 Jul 2009 23:25:25 +0200
changeset 9155 b46063eabe98
parent 9142 63cfacb7917e
child 9156 c9c7e8cdac9c
util: wrap at termwidth-2 by default
mercurial/util.py
--- 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))