diff -r 6f30c35766d6 -r a1ae0ed78d1a mercurial/minirst.py --- a/mercurial/minirst.py Sun Dec 13 22:37:30 2009 +0100 +++ b/mercurial/minirst.py Sun Dec 13 23:49:53 2009 +0100 @@ -113,7 +113,7 @@ _bulletre = re.compile(r'(-|[0-9A-Za-z]+\.|\(?[0-9A-Za-z]+\)) ') _optionre = re.compile(r'^(--[a-z-]+)((?:[ =][a-zA-Z][\w-]*)? +)(.*)$') -_fieldre = re.compile(r':(?![: ])([^:]*)(? _fieldwidth: + # key too large, use full line width + key = key.ljust(width) + elif keywidth + 2 < _fieldwidth: + # all keys are small, add only two spaces + key = key.ljust(keywidth + 2) + subindent = indent + (keywidth + 2) * ' ' + else: + # mixed sizes, use fieldwidth for this one + key = key.ljust(_fieldwidth) + block['lines'][0] = key + block['lines'][0] elif block['type'] == 'option': m = _optionre.match(block['lines'][0]) option, arg, rest = m.groups() @@ -252,6 +289,7 @@ blocks = findliteralblocks(blocks) blocks = inlineliterals(blocks) blocks = splitparagraphs(blocks) + blocks = updatefieldlists(blocks) blocks = findsections(blocks) blocks = addmargins(blocks) return '\n'.join(formatblock(b, width) for b in blocks) @@ -272,6 +310,7 @@ blocks = debug(findliteralblocks, blocks) blocks = debug(inlineliterals, blocks) blocks = debug(splitparagraphs, blocks) + blocks = debug(updatefieldlists, blocks) blocks = debug(findsections, blocks) blocks = debug(addmargins, blocks) print '\n'.join(formatblock(b, 30) for b in blocks)