diff -r ea798e03a32e -r 9b8c9266c59d mercurial/util.py --- a/mercurial/util.py Wed Jun 24 18:40:13 2009 +0200 +++ b/mercurial/util.py Wed Jun 24 19:15:58 2009 +0200 @@ -16,7 +16,7 @@ from i18n import _ import error, osutil import cStringIO, errno, re, shutil, sys, tempfile, traceback -import os, stat, time, calendar, random +import os, stat, time, calendar, random, textwrap import imp # Python compatibility @@ -1242,6 +1242,10 @@ pass return 80 +def wrap(line, hangindent, width=78): + padding = '\n' + ' ' * hangindent + return padding.join(textwrap.wrap(line, width=width - hangindent)) + def iterlines(iterator): for chunk in iterator: for line in chunk.splitlines():