~bzr-pqm/bzr/bzr.dev

« back to all changes in this revision

Viewing changes to bzrlib/rio.py

  • Committer: Aaron Bentley
  • Date: 2007-03-02 15:03:07 UTC
  • mto: (2323.6.9 0.15-integration)
  • mto: This revision was merged to the branch mainline in revision 2330.
  • Revision ID: abentley@panoramicfeedback.com-20070302150307-zg8n768fzowijv7l
Patch-RIO does line breaks in slightly more readable places

Show diffs side-by-side

added added

removed removed

Lines of Context:
326
326
            while len(line) > 0:
327
327
                partline = line[:max_rio_width]
328
328
                line = line[max_rio_width:]
 
329
                if len(line) > 0 and line[0] != [' ']:
 
330
                    break_index = -1
 
331
                    break_index = partline.rfind(' ', -20)
 
332
                    if break_index in (0, -1):
 
333
                        break_index = partline.rfind('-', -20)
 
334
                        break_index += 1
 
335
                    if break_index in (0, -1):
 
336
                        break_index = partline.rfind('/', -20)
 
337
                    if break_index not in (0, -1):
 
338
                        line = partline[break_index:] + line
 
339
                        partline = partline[:break_index]
329
340
                partline = re.sub('\r', '\\\\r', partline)
330
341
                blank_line = False
331
342
                if len(line) > 0: