Exemplo n.º 1
0
    def __init__(
        self,
        dump_filename,
        revision_writer,
        author_transforms=None,
        tie_tag_fixup_branches=True,
    ):
        """Constructor.

    See superclass for meaning of parameters.
    """
        GitOutputOption.__init__(self, dump_filename, revision_writer,
                                 author_transforms, tie_tag_fixup_branches)
Exemplo n.º 2
0
  def __init__(
        self, revision_writer,
        dump_filename=None,
        author_transforms=None,
        tie_tag_fixup_branches=True,
        ):
    """Constructor.

    See superclass for meaning of parameters.
    """
    GitOutputOption.__init__(
        self, revision_writer,
        dump_filename=dump_filename,
        author_transforms=author_transforms,
        tie_tag_fixup_branches=tie_tag_fixup_branches,
        )
Exemplo n.º 3
0
    def process_io_options(self):
        """Process input/output options.

    Process options related to extracting data from the CVS repository
    and writing to a Bazaar-friendly fast-import file."""

        ctx = Ctx()
        options = self.options

        not_both(options.use_rcs, '--use-rcs', options.use_cvs, '--use-cvs')

        if options.use_rcs:
            revision_reader = RCSRevisionReader(
                co_executable=options.co_executable)
        else:
            # --use-cvs is the default:
            revision_reader = CVSRevisionReader(
                cvs_executable=options.cvs_executable)

        if not ctx.dry_run and not options.dumpfile:
            raise FatalError("must pass '--dry-run' or '--dumpfile' option.")

        ctx.revision_recorder = NullRevisionRecorder()
        ctx.revision_excluder = NullRevisionExcluder()
        ctx.revision_reader = None

        ctx.output_option = GitOutputOption(
            options.dumpfile,
            GitRevisionInlineWriter(revision_reader),
            max_merges=None,
            # Optional map from CVS author names to bzr author names:
            author_transforms={},  # FIXME
        )
Exemplo n.º 4
0
 def process_output_options(self):
     """Process options related to fastimport output."""
     ctx = Ctx()
     if ctx.dry_run:
         ctx.output_option = NullOutputOption()
     else:
         ctx.output_option = GitOutputOption(
             GitRevisionMarkWriter(),
             dump_filename=self.options.dumpfile,
             # Optional map from CVS author names to git author names:
             author_transforms={},  # FIXME
         )
Exemplo n.º 5
0
    def process_io_options(self):
        """Process input/output options.

    Process options related to extracting data from the CVS repository
    and writing to 'git fast-import'-formatted files."""

        ctx = Ctx()
        options = self.options

        not_both(options.use_rcs, '--use-rcs', options.use_cvs, '--use-cvs')

        if options.use_rcs:
            revision_reader = RCSRevisionReader(
                co_executable=options.co_executable)
        else:
            # --use-cvs is the default:
            revision_reader = CVSRevisionReader(
                cvs_executable=options.cvs_executable)

        if ctx.dry_run:
            ctx.revision_recorder = NullRevisionRecorder()
        else:
            if not (options.blobfile and options.dumpfile):
                raise FatalError(
                    "must pass '--blobfile' and '--dumpfile' options.")
            ctx.revision_recorder = SimpleFulltextRevisionRecorderAdapter(
                revision_reader,
                GitRevisionRecorder(options.blobfile),
            )

        ctx.revision_excluder = NullRevisionExcluder()
        ctx.revision_reader = None

        ctx.output_option = GitOutputOption(
            options.dumpfile,
            GitRevisionMarkWriter(),
            max_merges=None,
            # Optional map from CVS author names to git author names:
            author_transforms={},  # FIXME
        )
Exemplo n.º 6
0
    'dionisos' : (u'Erik Hülsmann', '*****@*****.**'),

    # This one will be used for commits for which CVS doesn't record
    # the original author, as explained above.
    'cvs2git' : 'cvs2git <cvs2git>',
    }

# This is the main option that causes cvs2git to output to a
# "fastimport"-format dumpfile rather than to Subversion:
ctx.output_option = GitOutputOption(
    # The blobs will be written via the revision recorder, so in
    # OutputPass we only have to emit references to the blob marks:
    GitRevisionMarkWriter(),

    # The file in which to write the git-fast-import stream that
    # contains the changesets and branch/tag information, or None
    # to write it to stdout:
    dump_filename=os.path.join(ctx.tmpdir, 'git-dump.dat'),

    # Optional map from CVS author names to git author names:
    author_transforms=author_transforms,
    )

# Change this option to True to turn on profiling of cvs2git (for
# debugging purposes):
run_options.profiling = False


# Should CVSItem -> Changeset database files be memory mapped?  In
# some tests, using memory mapping speeded up the overall conversion
# by about 5%.  But this option can cause the conversion to fail with