From 9590d77db47bb8f6b7ff081754d36006ed0a82f4 Mon Sep 17 00:00:00 2001 From: mhagger Date: Mon, 3 Feb 2014 12:52:00 +0000 Subject: [PATCH] GitOutputOption: Change the order of constructor parameters. Ditto for BzrOutputOption. git-svn-id: http://cvs2svn.tigris.org/svn/cvs2svn/trunk@5444 be7e6eca-30d4-0310-a8e5-ac0d63af7087 --- cvs2git-example.options | 8 ++++---- cvs2hg-example.options | 8 ++++---- cvs2svn_lib/bzr_output_option.py | 8 +++++--- cvs2svn_lib/git_output_option.py | 10 +++++----- cvs2svn_lib/git_run_options.py | 2 +- 5 files changed, 19 insertions(+), 17 deletions(-) diff --git a/cvs2git-example.options b/cvs2git-example.options index 17f26c8c..5acf439d 100644 --- a/cvs2git-example.options +++ b/cvs2git-example.options @@ -533,14 +533,14 @@ author_transforms={ # This is the main option that causes cvs2git to output to a # "fastimport"-format dumpfile rather than to Subversion: ctx.output_option = GitOutputOption( - # The file in which to write the git-fast-import stream that - # contains the changesets and branch/tag information: - os.path.join(ctx.tmpdir, 'git-dump.dat'), - # 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: + os.path.join(ctx.tmpdir, 'git-dump.dat'), + # Optional map from CVS author names to git author names: author_transforms=author_transforms, ) diff --git a/cvs2hg-example.options b/cvs2hg-example.options index e1f13fc2..5ef9a3e0 100644 --- a/cvs2hg-example.options +++ b/cvs2hg-example.options @@ -483,10 +483,6 @@ author_transforms={ # This is the main option that causes cvs2hg to output to an "hg # fastimport"-format dumpfile rather than to Subversion: ctx.output_option = GitOutputOption( - # The file in which to write the "hg fastimport" stream that - # contains the changesets and branch/tag information: - os.path.join(ctx.tmpdir, 'hg-dump.dat'), - # Write the file contents inline in the "hg fastimport" stream, # rather than using a separate blobs file (which "hg fastimport" # cannot handle). @@ -499,6 +495,10 @@ ctx.output_option = GitOutputOption( CVSRevisionReader(cvs_executable=r'cvs') ), + # The file in which to write the "hg fastimport" stream that + # contains the changesets and branch/tag information: + os.path.join(ctx.tmpdir, 'hg-dump.dat'), + # Optional map from CVS author names to hg author names: author_transforms=author_transforms, ) diff --git a/cvs2svn_lib/bzr_output_option.py b/cvs2svn_lib/bzr_output_option.py index 28061022..c17e80b0 100644 --- a/cvs2svn_lib/bzr_output_option.py +++ b/cvs2svn_lib/bzr_output_option.py @@ -33,7 +33,7 @@ class BzrOutputOption(GitOutputOption): name = "Bzr" def __init__( - self, dump_filename, revision_writer, + self, revision_writer, dump_filename, author_transforms=None, tie_tag_fixup_branches=True, ): @@ -41,8 +41,10 @@ class BzrOutputOption(GitOutputOption): See superclass for meaning of parameters. """ - GitOutputOption.__init__(self, dump_filename, revision_writer, - author_transforms, tie_tag_fixup_branches) + GitOutputOption.__init__( + self, revision_writer, dump_filename, + author_transforms, tie_tag_fixup_branches, + ) def get_tag_fixup_branch_name(self, svn_commit): # Use a name containing '.', which is not allowed in CVS symbols, to avoid diff --git a/cvs2svn_lib/git_output_option.py b/cvs2svn_lib/git_output_option.py index 935f8d90..ee29bcb4 100644 --- a/cvs2svn_lib/git_output_option.py +++ b/cvs2svn_lib/git_output_option.py @@ -167,21 +167,21 @@ class GitOutputOption(DVCSOutputOption): _first_commit_mark = 1000000000 def __init__( - self, dump_filename, revision_writer, + self, revision_writer, dump_filename, author_transforms=None, tie_tag_fixup_branches=False, ): """Constructor. + REVISION_WRITER is a GitRevisionWriter that is used to output + either the content of revisions or a mark that was previously used + to label a blob. + DUMP_FILENAME is the name of the file to which the git-fast-import commands for defining revisions should be written. (Please note that depending on the style of revision writer, the actual file contents might not be written to this file.) - REVISION_WRITER is a GitRevisionWriter that is used to output - either the content of revisions or a mark that was previously used - to label a blob. - AUTHOR_TRANSFORMS is a map {cvsauthor : (fullname, email)} from CVS author names to git full name and email address. All of the contents should either be Unicode strings or 8-bit strings encoded diff --git a/cvs2svn_lib/git_run_options.py b/cvs2svn_lib/git_run_options.py index 9c12db72..ae4bdb4f 100644 --- a/cvs2svn_lib/git_run_options.py +++ b/cvs2svn_lib/git_run_options.py @@ -193,8 +193,8 @@ A directory under \\fI%s\\fR (or the directory specified by ctx.output_option = NullOutputOption() else: ctx.output_option = GitOutputOption( - self.options.dumpfile, GitRevisionMarkWriter(), + self.options.dumpfile, # Optional map from CVS author names to git author names: author_transforms={}, # FIXME ) -- 2.11.4.GIT