16
16
"""Fastimport/fastexport commands."""
18
from __future__ import absolute_import
20
18
from ... import controldir
21
19
from ...commands import Command
22
20
from ...option import Option, RegistryOption
23
from ...sixish import (
242
237
_see_also = ['fast-export', 'fast-import-filter', 'fast-import-info']
243
238
takes_args = ['source', 'destination?']
244
239
takes_options = ['verbose',
245
Option('user-map', type=text_type,
240
Option('user-map', type=str,
246
241
help="Path to file containing a map of user-ids.",
248
Option('info', type=text_type,
243
Option('info', type=str,
249
244
help="Path to file containing caching hints.",
271
266
experimental="Enable experimental features.",
272
267
value_switches=True, enum_switch=False,
274
Option('import-marks', type=text_type,
269
Option('import-marks', type=str,
275
270
help="Import marks from file."
277
Option('export-marks', type=text_type,
272
Option('export-marks', type=str,
278
273
help="Export marks to file."
280
275
RegistryOption('format',
322
317
user_map=user_map)
324
319
def _generate_info(self, source):
325
from ...sixish import StringIO
320
from io import StringIO
326
321
from fastimport import parser
327
322
from fastimport.errors import ParsingError
328
323
from ...errors import CommandError
448
443
_see_also = ['fast-import', 'fast-import-filter']
449
444
takes_args = ['source?', 'destination?']
450
445
takes_options = ['verbose', 'revision',
451
Option('git-branch', short_name='b', type=text_type,
446
Option('git-branch', short_name='b', type=str,
453
448
help='Name of the git branch to create (default=master).'
455
450
Option('checkpoint', type=int, argname='N',
456
451
help="Checkpoint every N revisions (default=10000)."
458
Option('marks', type=text_type, argname='FILE',
453
Option('marks', type=str, argname='FILE',
459
454
help="Import marks from and export marks to file."
461
Option('import-marks', type=text_type, argname='FILE',
456
Option('import-marks', type=str, argname='FILE',
462
457
help="Import marks from file."
464
Option('export-marks', type=text_type, argname='FILE',
459
Option('export-marks', type=str, argname='FILE',
465
460
help="Export marks to file."