##// END OF EJS Templates
minirst: simplify and standardize field list formatting...
Olav Reinert -
r15861:ee8f5e4c default
parent child Browse files
Show More
@@ -162,28 +162,24 def splitparagraphs(blocks):
162 162 i += 1
163 163 return blocks
164 164
165 _fieldwidth = 12
165 _fieldwidth = 14
166 166
167 167 def updatefieldlists(blocks):
168 """Find key and maximum key width for field lists."""
168 """Find key for field lists."""
169 169 i = 0
170 170 while i < len(blocks):
171 171 if blocks[i]['type'] != 'field':
172 172 i += 1
173 173 continue
174 174
175 keywidth = 0
176 175 j = i
177 176 while j < len(blocks) and blocks[j]['type'] == 'field':
178 177 m = _fieldre.match(blocks[j]['lines'][0])
179 178 key, rest = m.groups()
180 179 blocks[j]['lines'][0] = rest
181 180 blocks[j]['key'] = key
182 keywidth = max(keywidth, len(key))
183 181 j += 1
184 182
185 for block in blocks[i:j]:
186 block['keywidth'] = keywidth
187 183 i = j + 1
188 184
189 185 return blocks
@@ -492,19 +488,13 def formatblock(block, width):
492 488 m = _bulletre.match(block['lines'][0])
493 489 subindent = indent + m.end() * ' '
494 490 elif block['type'] == 'field':
495 keywidth = block['keywidth']
496 491 key = block['key']
497
498 492 subindent = indent + _fieldwidth * ' '
499 493 if len(key) + 2 > _fieldwidth:
500 494 # key too large, use full line width
501 495 key = key.ljust(width)
502 elif keywidth + 2 < _fieldwidth:
503 # all keys are small, add only two spaces
504 key = key.ljust(keywidth + 2)
505 subindent = indent + (keywidth + 2) * ' '
506 496 else:
507 # mixed sizes, use fieldwidth for this one
497 # key fits within field width
508 498 key = key.ljust(_fieldwidth)
509 499 block['lines'][0] = key + block['lines'][0]
510 500 elif block['type'] == 'option':
@@ -128,12 +128,13
128 128 you can set on the command line with "--config":
129 129
130 130 convert.hg.ignoreerrors
131 ignore integrity errors when reading. Use it to fix Mercurial
132 repositories with missing revlogs, by converting from and to
133 Mercurial. Default is False.
131 ignore integrity errors when reading. Use it to fix
132 Mercurial repositories with missing revlogs, by converting
133 from and to Mercurial. Default is False.
134 134 convert.hg.saverev
135 store original revision ID in changeset (forces target IDs to
136 change). It takes a boolean argument and defaults to False.
135 store original revision ID in changeset (forces target IDs
136 to change). It takes a boolean argument and defaults to
137 False.
137 138 convert.hg.startrev
138 139 convert start revision and its descendants. It takes a hg
139 140 revision identifier and defaults to 0.
@@ -156,33 +157,32
156 157 Set to False to disable remote log caching, for testing and
157 158 debugging purposes. Default is True.
158 159 convert.cvsps.fuzz
159 Specify the maximum time (in seconds) that is allowed between
160 commits with identical user and log message in a single
161 changeset. When very large files were checked in as part of a
162 changeset then the default may not be long enough. The default
163 is 60.
160 Specify the maximum time (in seconds) that is allowed
161 between commits with identical user and log message in a
162 single changeset. When very large files were checked in as
163 part of a changeset then the default may not be long enough.
164 The default is 60.
164 165 convert.cvsps.mergeto
165 Specify a regular expression to which commit log messages are
166 matched. If a match occurs, then the conversion process will
167 insert a dummy revision merging the branch on which this log
168 message occurs to the branch indicated in the regex. Default
169 is "{{mergetobranch ([-\w]+)}}"
166 Specify a regular expression to which commit log messages
167 are matched. If a match occurs, then the conversion process
168 will insert a dummy revision merging the branch on which
169 this log message occurs to the branch indicated in the
170 regex. Default is "{{mergetobranch ([-\w]+)}}"
170 171 convert.cvsps.mergefrom
171 Specify a regular expression to which commit log messages are
172 matched. If a match occurs, then the conversion process will
173 add the most recent revision on the branch indicated in the
174 regex as the second parent of the changeset. Default is
172 Specify a regular expression to which commit log messages
173 are matched. If a match occurs, then the conversion process
174 will add the most recent revision on the branch indicated in
175 the regex as the second parent of the changeset. Default is
175 176 "{{mergefrombranch ([-\w]+)}}"
176 hook.cvslog
177 Specify a Python function to be called at the end of gathering
178 the CVS log. The function is passed a list with the log
179 entries, and can modify the entries in-place, or add or delete
180 them.
177 hook.cvslog Specify a Python function to be called at the end of
178 gathering the CVS log. The function is passed a list with
179 the log entries, and can modify the entries in-place, or add
180 or delete them.
181 181 hook.cvschangesets
182 182 Specify a Python function to be called after the changesets
183 are calculated from the the CVS log. The function is passed a
184 list with the changeset entries, and can modify the changesets
185 in-place, or add or delete them.
183 are calculated from the the CVS log. The function is passed
184 a list with the changeset entries, and can modify the
185 changesets in-place, or add or delete them.
186 186
187 187 An additional "debugcvsps" Mercurial command allows the builtin changeset
188 188 merging code to be run without doing a conversion. Its parameters and
@@ -208,9 +208,11
208 208 specify the directory containing branches. The default is
209 209 "branches".
210 210 convert.svn.tags
211 specify the directory containing tags. The default is "tags".
211 specify the directory containing tags. The default is
212 "tags".
212 213 convert.svn.trunk
213 specify the name of the trunk branch. The default is "trunk".
214 specify the name of the trunk branch. The default is
215 "trunk".
214 216
215 217 Source history can be retrieved starting at a specific revision, instead
216 218 of being integrally converted. Only single branch conversions are
@@ -415,8 +415,8 marker after the option. It is treated a
415 415 60 column format:
416 416 ----------------------------------------------------------------------
417 417 a First item.
418 ab Second item. Indentation and wrapping is handled
419 automatically.
418 ab Second item. Indentation and wrapping is
419 handled automatically.
420 420
421 421 Next list:
422 422
@@ -429,8 +429,10 much too large
429 429 30 column format:
430 430 ----------------------------------------------------------------------
431 431 a First item.
432 ab Second item. Indentation
433 and wrapping is handled
432 ab Second item.
433 Indentation and
434 wrapping is
435 handled
434 436 automatically.
435 437
436 438 Next list:
@@ -441,8 +443,8 small The larger key
441 443 here.
442 444 much too large
443 445 This key is big
444 enough to get its
445 own line.
446 enough to get
447 its own line.
446 448 ----------------------------------------------------------------------
447 449
448 450 html format:
General Comments 0
You need to be logged in to leave comments. Login now