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