1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52
|
--- a/cvs2svn_lib/git_output_option.py
+++ b/cvs2svn_lib/git_output_option.py
@@ -148,6 +148,7 @@ class GitOutputOption(DVCSOutputOption):
self, dump_filename, revision_writer,
author_transforms=None,
tie_tag_fixup_branches=False,
+ cvs_domain='',
):
"""Constructor.
@@ -178,6 +179,7 @@ class GitOutputOption(DVCSOutputOption):
self.author_transforms = self.normalize_author_transforms(
author_transforms
)
+ self.cvs_domain = cvs_domain
self.tie_tag_fixup_branches = tie_tag_fixup_branches
@@ -242,6 +244,8 @@ class GitOutputOption(DVCSOutputOption):
return self._map_author(cvs_author)
def _map_author(self, cvs_author):
+ if self.cvs_domain:
+ return "%s <%s@%s>" % (cvs_author, cvs_author, self.cvs_domain)
return self.author_transforms.get(cvs_author, "%s <>" % (cvs_author,))
@staticmethod
--- a/cvs2svn_lib/git_run_options.py
+++ b/cvs2svn_lib/git_run_options.py
@@ -111,6 +111,16 @@ A directory called \\fIcvs2svn-tmp\\fR (
'Do not create any output; just print what would happen.'
),
))
+ group.add_option(IncompatibleOption(
+ '--cvs-domain', type='string',
+ action='store',
+ help='domain for CVS user to eMail mapping',
+ man_help=(
+ 'Enables writing \\fIcvsusername\\fR@\\fIdomain\\fR style'
+ 'eMail addresses to the git commits.'
+ ),
+ metavar='DOMAIN',
+ ))
return group
@@ -193,4 +203,5 @@ A directory called \\fIcvs2svn-tmp\\fR (
GitRevisionMarkWriter(),
# Optional map from CVS author names to git author names:
author_transforms={}, # FIXME
+ cvs_domain=self.options.cvs_domain,
)
|