Beispiel #1
0
    def _get_extraction_options_group(self):
        group = RunOptions._get_extraction_options_group(self)

        self.parser.set_default('use_cvs', False)
        group.add_option(
            IncompatibleOption(
                '--use-cvs',
                action='store_true',
                help=('use CVS to extract revision contents (slower than '
                      '--use-rcs but more reliable) (default)'),
                man_help=
                ('Use CVS to extract revision contents.  This option is slower '
                 'than \\fB--use-rcs\\fR but more reliable.'),
            ))
        self.parser.set_default('use_rcs', False)
        group.add_option(
            IncompatibleOption(
                '--use-rcs',
                action='store_true',
                help=('use RCS to extract revision contents (faster than '
                      '--use-cvs but fails in some cases)'),
                man_help=
                ('Use RCS \'co\' to extract revision contents.  This option is '
                 'faster than \\fB--use-cvs\\fR but fails in some cases.'),
            ))

        return group
Beispiel #2
0
    def _get_extraction_options_group(self):
        group = DVCSRunOptions._get_extraction_options_group(self)
        self._add_use_cvs_option(group)
        self._add_use_rcs_option(group)
        self.parser.set_default('use_external_blob_generator', False)
        group.add_option(
            IncompatibleOption(
                '--use-external-blob-generator',
                action='store_true',
                help=(
                    'Use an external Python program to extract file revision '
                    'contents (much faster than --use-rcs or --use-cvs but '
                    'leaves keywords unexpanded and requires a separate, '
                    'seekable blob file to write to in parallel to the main '
                    'cvs2git script.'),
                man_help=
                ('Use an external Python program to extract the file revision '
                 'contents from the RCS files and output them to the blobfile.  '
                 'This option is much faster than \\fB--use-rcs\\fR or '
                 '\\fB--use-cvs\\fR but leaves keywords unexpanded and requires '
                 'a separate, seekable blob file to write to in parallel to the '
                 'main cvs2git script.'),
            ))

        return group
    def _get_extraction_options_group(self):
        group = RunOptions._get_extraction_options_group(self)

        self.parser.set_default('use_internal_co', False)
        group.add_option(
            IncompatibleOption(
                '--use-internal-co',
                action='store_true',
                help=('use internal code to extract revision contents '
                      '(fastest but disk space intensive) (default)'),
                man_help=
                ('Use internal code to extract revision contents.  This '
                 'is up to 50% faster than using \\fB--use-rcs\\fR, but needs '
                 'a lot of disk space: roughly the size of your CVS repository '
                 'plus the peak size of a complete checkout of the repository '
                 'with all branches that existed and still had commits pending '
                 'at a given time.  This option is the default.'),
            ))
        self.parser.set_default('use_cvs', False)
        group.add_option(
            IncompatibleOption(
                '--use-cvs',
                action='store_true',
                help=('use CVS to extract revision contents (slower than '
                      '--use-internal-co or --use-rcs)'),
                man_help=
                ('Use CVS to extract revision contents.  This option is slower '
                 'than \\fB--use-internal-co\\fR or \\fB--use-rcs\\fR.'),
            ))
        self.parser.set_default('use_rcs', False)
        group.add_option(
            IncompatibleOption(
                '--use-rcs',
                action='store_true',
                help=('use RCS to extract revision contents (faster than '
                      '--use-cvs but fails in some cases)'),
                man_help=
                ('Use RCS \'co\' to extract revision contents.  This option is '
                 'faster than \\fB--use-cvs\\fR but fails in some cases.'),
            ))

        return group
Beispiel #4
0
    def _get_output_options_group(self):
        group = DVCSRunOptions._get_output_options_group(self)

        group.add_option(
            IncompatibleOption(
                '--blobfile',
                type='string',
                action='store',
                help='path to which the "blob" data should be written',
                man_help=
                ('Write the "blob" data (containing revision contents) to '
                 '\\fIpath\\fR.  If not set, the blob data is written to the '
                 'same destination as the dumpfile output.'),
                metavar='PATH',
            ))
        group.add_option(
            IncompatibleOption(
                '--dumpfile',
                type='string',
                action='store',
                help='path to which the revision data should be written',
                man_help=
                ('Write the revision data (branches and commits) to \\fIpath\\fR.  '
                 'If not set, output goes to stdout.'),
                metavar='PATH',
            ))
        group.add_option(
            ContextOption(
                '--dry-run',
                action='store_true',
                help=(
                    'do not create any output; just print what would happen.'),
                man_help=(
                    'Do not create any output; just print what would happen.'),
            ))

        return group
Beispiel #5
0
    def _get_output_options_group(self):
        group = super(GitRunOptions, self)._get_output_options_group()

        group.add_option(
            IncompatibleOption(
                '--blobfile',
                type='string',
                action='store',
                help='path to which the "blob" data should be written',
                man_help=(
                    'Write the "blob" data (containing revision contents) to '
                    '\\fIpath\\fR.'),
                metavar='PATH',
            ))
        group.add_option(
            IncompatibleOption(
                '--dumpfile',
                type='string',
                action='store',
                help='path to which the revision data should be written',
                man_help=
                ('Write the revision data (branches and commits) to \\fIpath\\fR.'
                 ),
                metavar='PATH',
            ))
        group.add_option(
            ContextOption(
                '--dry-run',
                action='store_true',
                help=(
                    'do not create any output; just print what would happen.'),
                man_help=(
                    'Do not create any output; just print what would happen.'),
            ))

        return group
Beispiel #6
0
  def _get_output_options_group(self):
    group = super(HgRunOptions, self)._get_output_options_group()

    # XXX what if the hg repo already exists? die, clobber, or append?
    # (currently we die at the start of OutputPass)
    group.add_option(IncompatibleOption(
      '--hgrepos', type='string',
      action='store',
      help='create Mercurial repository in PATH',
      man_help=(
          'Convert to a Mercurial repository in \\fIpath\\fR.  This creates '
          'a new Mercurial repository at \\fIpath\\fR.  \\fIpath\\fR must '
          'not already exist.'
          ),
      metavar='PATH',
      ))

    # XXX --dry-run?

    return group
Beispiel #7
0
    def _get_extraction_options_group(self):
        group = super(DVCSRunOptions, self)._get_extraction_options_group()
        self.parser.set_default('force_keyword_mode', 'no')
        group.add_option(
            IncompatibleOption(
                '--force-keyword-mode',
                type='choice',
                choices=['untouched', 'collapsed', 'expanded', 'kept', 'no'],
                action='store',
                help='force (untouched, collapsed, expanded, kept), or no',
                man_help=(
                    'Keyword mode to force, or \\fIno\\fR to use the default. '
                    '\\fIopt\\fR can be \'untouched\' (keep literally as they '
                    'are recorded in the RCS file), \'collapsed\' (retain the '
                    'key but not the value), \'expanded\' (fake the way CVS '
                    'expands them, even for binaries), \'kept\' (just let CVS '
                    'deal with keywords).'),
                metavar='OPT',
            ))

        return group
Beispiel #8
0
    def _get_output_options_group(self):
        group = DVCSRunOptions._get_output_options_group(self)

        group.add_option(
            IncompatibleOption(
                '--dumpfile',
                type='string',
                action='store',
                help='path to which the data should be written',
                man_help=(
                    'Write the blobs and revision data to \\fIpath\\fR.'),
                metavar='PATH',
            ))
        group.add_option(
            ContextOption(
                '--dry-run',
                action='store_true',
                help=(
                    'do not create any output; just print what would happen.'),
                man_help=(
                    'Do not create any output; just print what would happen.'),
            ))

        return group
    def _get_output_options_group(self):
        group = RunOptions._get_output_options_group(self)

        group.add_option(
            IncompatibleOption(
                '--svnrepos',
                '-s',
                type='string',
                action='store',
                help='path where SVN repos should be created',
                man_help=
                ('Write the output of the conversion into a Subversion repository '
                 'located at \\fIpath\\fR.  This option causes a new Subversion '
                 'repository to be created at \\fIpath\\fR unless the '
                 '\\fB--existing-svnrepos\\fR option is also used.'),
                metavar='PATH',
            ))
        self.parser.set_default('existing_svnrepos', False)
        group.add_option(
            IncompatibleOption(
                '--existing-svnrepos',
                action='store_true',
                help=
                'load into existing SVN repository (for use with --svnrepos)',
                man_help=
                ('Load the converted CVS repository into an existing Subversion '
                 'repository, instead of creating a new repository.  (This option '
                 'should be used in combination with '
                 '\\fB-s\\fR/\\fB--svnrepos\\fR.)  The repository must either be '
                 'empty or contain no paths that overlap with those that will '
                 'result from the conversion.  Please note that you need write '
                 'permission for the repository files.'),
            ))
        group.add_option(
            IncompatibleOption(
                '--fs-type',
                type='string',
                action='store',
                help=('pass --fs-type=TYPE to "svnadmin create" (for use with '
                      '--svnrepos)'),
                man_help=
                ('Pass \\fI--fs-type\\fR=\\fItype\\fR to "svnadmin create" when '
                 'creating a new repository.'),
                metavar='TYPE',
            ))
        self.parser.set_default('bdb_txn_nosync', False)
        group.add_option(
            IncompatibleOption(
                '--bdb-txn-nosync',
                action='store_true',
                help=(
                    'pass --bdb-txn-nosync to "svnadmin create" (for use with '
                    '--svnrepos)'),
                man_help=(
                    'Pass \\fI--bdb-txn-nosync\\fR to "svnadmin create" when '
                    'creating a new BDB-style Subversion repository.'),
            ))
        self.parser.set_default('create_options', [])
        group.add_option(
            IncompatibleOption(
                '--create-option',
                type='string',
                action='append',
                dest='create_options',
                help='pass OPT to "svnadmin create" (for use with --svnrepos)',
                man_help=
                ('Pass \\fIopt\\fR to "svnadmin create" when creating a new '
                 'Subversion repository (can be specified multiple times to '
                 'pass multiple options).'),
                metavar='OPT',
            ))
        group.add_option(
            IncompatibleOption(
                '--dumpfile',
                type='string',
                action='store',
                help='just produce a dumpfile; don\'t commit to a repos',
                man_help=
                ('Just produce a dumpfile; don\'t commit to an SVN repository. '
                 'Write the dumpfile to \\fIpath\\fR.'),
                metavar='PATH',
            ))

        group.add_option(
            ContextOption(
                '--dry-run',
                action='store_true',
                help=(
                    'do not create a repository or a dumpfile; just print what '
                    'would happen.'),
                man_help=
                ('Do not create a repository or a dumpfile; just print the '
                 'details of what cvs2svn would do if it were really converting '
                 'your repository.'),
            ))

        # Deprecated options:
        self.parser.set_default('dump_only', False)
        group.add_option(
            IncompatibleOption(
                '--dump-only',
                action='callback',
                callback=self.callback_dump_only,
                help=optparse.SUPPRESS_HELP,
                man_help=optparse.SUPPRESS_HELP,
            ))
        group.add_option(
            IncompatibleOption(
                '--create',
                action='callback',
                callback=self.callback_create,
                help=optparse.SUPPRESS_HELP,
                man_help=optparse.SUPPRESS_HELP,
            ))

        return group
    def _get_conversion_options_group(self):
        group = RunOptions._get_conversion_options_group(self)

        self.parser.set_default('trunk_base', config.DEFAULT_TRUNK_BASE)
        group.add_option(
            IncompatibleOption(
                '--trunk',
                type='string',
                action='store',
                dest='trunk_base',
                help=('path for trunk (default: %s)' %
                      (config.DEFAULT_TRUNK_BASE, )),
                man_help=(
                    'Set the top-level path to use for trunk in the Subversion '
                    'repository. The default is \\fI%s\\fR.' %
                    (config.DEFAULT_TRUNK_BASE, )),
                metavar='PATH',
            ))
        self.parser.set_default('branches_base', config.DEFAULT_BRANCHES_BASE)
        group.add_option(
            IncompatibleOption(
                '--branches',
                type='string',
                action='store',
                dest='branches_base',
                help=('path for branches (default: %s)' %
                      (config.DEFAULT_BRANCHES_BASE, )),
                man_help=
                ('Set the top-level path to use for branches in the Subversion '
                 'repository.  The default is \\fI%s\\fR.' %
                 (config.DEFAULT_BRANCHES_BASE, )),
                metavar='PATH',
            ))
        self.parser.set_default('tags_base', config.DEFAULT_TAGS_BASE)
        group.add_option(
            IncompatibleOption(
                '--tags',
                type='string',
                action='store',
                dest='tags_base',
                help=('path for tags (default: %s)' %
                      (config.DEFAULT_TAGS_BASE, )),
                man_help=(
                    'Set the top-level path to use for tags in the Subversion '
                    'repository. The default is \\fI%s\\fR.' %
                    (config.DEFAULT_TAGS_BASE, )),
                metavar='PATH',
            ))
        group.add_option(
            ContextOption(
                '--no-prune',
                action='store_false',
                dest='prune',
                help='don\'t prune empty directories',
                man_help=
                ('When all files are deleted from a directory in the Subversion '
                 'repository, don\'t delete the empty directory (the default is '
                 'to delete any empty directories).'),
            ))
        group.add_option(
            ContextOption(
                '--no-cross-branch-commits',
                action='store_false',
                dest='cross_branch_commits',
                help='prevent the creation of cross-branch commits',
                man_help=
                ('Prevent the creation of commits that affect files on multiple '
                 'branches at once.'),
            ))

        return group
Beispiel #11
0
    def _get_conversion_options_group(self):
        group = super(SVNRunOptions, self)._get_conversion_options_group()

        self.parser.set_default('trunk_base', config.DEFAULT_TRUNK_BASE)
        group.add_option(
            IncompatibleOption(
                '--trunk',
                type='string',
                action='store',
                dest='trunk_base',
                help=('path for trunk (default: %s)' %
                      (config.DEFAULT_TRUNK_BASE, )),
                man_help=(
                    'Set the top-level path to use for trunk in the Subversion '
                    'repository. The default is \\fI%s\\fR.' %
                    (config.DEFAULT_TRUNK_BASE, )),
                metavar='PATH',
            ))
        self.parser.set_default('branches_base', config.DEFAULT_BRANCHES_BASE)
        group.add_option(
            IncompatibleOption(
                '--branches',
                type='string',
                action='store',
                dest='branches_base',
                help=('path for branches (default: %s)' %
                      (config.DEFAULT_BRANCHES_BASE, )),
                man_help=
                ('Set the top-level path to use for branches in the Subversion '
                 'repository.  The default is \\fI%s\\fR.' %
                 (config.DEFAULT_BRANCHES_BASE, )),
                metavar='PATH',
            ))
        self.parser.set_default('tags_base', config.DEFAULT_TAGS_BASE)
        group.add_option(
            IncompatibleOption(
                '--tags',
                type='string',
                action='store',
                dest='tags_base',
                help=('path for tags (default: %s)' %
                      (config.DEFAULT_TAGS_BASE, )),
                man_help=(
                    'Set the top-level path to use for tags in the Subversion '
                    'repository. The default is \\fI%s\\fR.' %
                    (config.DEFAULT_TAGS_BASE, )),
                metavar='PATH',
            ))
        group.add_option(
            ContextOption(
                '--include-empty-directories',
                action='store_true',
                dest='include_empty_directories',
                help=('include empty directories within the CVS repository '
                      'in the conversion'),
                man_help=
                ('Treat empty subdirectories within the CVS repository as actual '
                 'directories, creating them when the parent directory is created '
                 'and removing them if and when the parent directory is pruned.'
                 ),
            ))
        group.add_option(
            ContextOption(
                '--no-prune',
                action='store_false',
                dest='prune',
                help='don\'t prune empty directories',
                man_help=
                ('When all files are deleted from a directory in the Subversion '
                 'repository, don\'t delete the empty directory (the default is '
                 'to delete any empty directories).'),
            ))
        group.add_option(
            ContextOption(
                '--no-cross-branch-commits',
                action='store_false',
                dest='cross_branch_commits',
                help='prevent the creation of cross-branch commits',
                man_help=
                ('Prevent the creation of commits that affect files on multiple '
                 'branches at once.'),
            ))

        return group