Example #1
0
    def process_output_options(self):
        """Process options related to fastimport output."""
        ctx = Ctx()
        options = self.options

        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.")

        # See cvs2bzr-example.options for explanations of these
        ctx.revision_collector = NullRevisionCollector()
        ctx.revision_reader = None

        if ctx.dry_run:
            ctx.output_option = NullOutputOption()
        else:
            ctx.output_option = BzrOutputOption(
                options.dumpfile,
                GitRevisionInlineWriter(revision_reader),
                # Optional map from CVS author names to bzr author names:
                author_transforms={},  # FIXME
            )
Example #2
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
         )