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