Skip to content

Commit

Permalink
add support for domains for git commit eMail tags
Browse files Browse the repository at this point in the history
  • Loading branch information
mirabilos committed Jun 25, 2014
1 parent 90d8b6a commit cfc8797
Show file tree
Hide file tree
Showing 10 changed files with 81 additions and 10 deletions.
13 changes: 9 additions & 4 deletions cvs2git
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,7 @@
# damage or existence of a defect, except proven that it results out
# of said person’s immediate fault when using the work as intended.
#-
# requires cvs2svn (2.4.0-2tarent1)
# requires cvs2svn (2.4.0-2tarent2)

# needs mksh R50 2014/06/10
set -o pipefail
Expand All @@ -40,7 +40,7 @@ set -A pprm_branches
set -A pprm_tags
set -A torm_branches
set -A torm_tags
unset source remote prepend
unset domain source remote prepend cvs2git_username
. "$mydir/$cfg"
for var in source remote; do
eval '[[ -n $'$var' ]]' && continue
Expand All @@ -51,6 +51,11 @@ if [[ ! -d $source/. ]]; then
print -ru2 "E: config file '$cfg' source '$source' does not exist"
exit 1
fi
[[ -n $cvs2git_username ]] || if [[ -n $domain ]]; then
cvs2git_username=root
else
cvs2git_username=cvs2git
fi

# not in /tmp due to sheer size of tmp files
if ! T=$(mktemp -d /var/tmp/cvs2git.XXXXXXXXXX); then
Expand Down Expand Up @@ -88,9 +93,9 @@ print -u2 "I: $SECONDS seconds elapsed for setup"

cvs2git --blobfile=blobfile --dumpfile=dumpfile \
--encoding=utf-8 --fallback-encoding=cp1252 \
--username=cvs2git --keywords-off --keep-cvsignore \
--username="$cvs2git_username" --keywords-off --keep-cvsignore \
--use-cvs --cvs="$T"/cvswrapper \
--force-keyword-mode=kept \
--force-keyword-mode=kept ${domain:+--cvs-domain="$domain"} \
"$source" || die "cvs2git failed with errorlevel $?"
print -u2 "I: $SECONDS seconds elapsed for cvs2git"

Expand Down
70 changes: 64 additions & 6 deletions cvs2svn_2.4.0-2tarent1.debdiff → cvs2svn_2.4.0-2tarent2.debdiff
Original file line number Diff line number Diff line change
@@ -1,17 +1,74 @@
diff -Nru cvs2svn-2.4.0/debian/changelog cvs2svn-2.4.0/debian/changelog
--- cvs2svn-2.4.0/debian/changelog 2014-02-06 20:16:02.000000000 +0100
+++ cvs2svn-2.4.0/debian/changelog 2014-06-25 11:24:45.000000000 +0200
@@ -1,3 +1,10 @@
+cvs2svn (2.4.0-2tarent1) tarent; urgency=medium
+++ cvs2svn-2.4.0/debian/changelog 2014-06-25 12:34:22.000000000 +0200
@@ -1,3 +1,11 @@
+cvs2svn (2.4.0-2tarent2) tarent; urgency=medium
+
+ * Non-maintainer upload.
+ * debian/patches/force-keyword-mode.patch: New.
+ * debian/patches/cvs-domain.patch: New.
+
+ -- Thorsten Glaser <[email protected]> Wed, 25 Jun 2014 11:24:27 +0200
+ -- Thorsten Glaser <[email protected]> Wed, 25 Jun 2014 12:34:14 +0200
+
cvs2svn (2.4.0-2) unstable; urgency=low

* Run tests, but don't fail on them as only the Subversion output changed
diff -Nru cvs2svn-2.4.0/debian/patches/cvs-domain.patch cvs2svn-2.4.0/debian/patches/cvs-domain.patch
--- cvs2svn-2.4.0/debian/patches/cvs-domain.patch 1970-01-01 01:00:00.000000000 +0100
+++ cvs2svn-2.4.0/debian/patches/cvs-domain.patch 2014-06-25 12:34:00.000000000 +0200
@@ -0,0 +1,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,
+ )
diff -Nru cvs2svn-2.4.0/debian/patches/force-keyword-mode.patch cvs2svn-2.4.0/debian/patches/force-keyword-mode.patch
--- cvs2svn-2.4.0/debian/patches/force-keyword-mode.patch 1970-01-01 01:00:00.000000000 +0100
+++ cvs2svn-2.4.0/debian/patches/force-keyword-mode.patch 2014-06-25 11:26:46.000000000 +0200
Expand Down Expand Up @@ -152,8 +209,9 @@ diff -Nru cvs2svn-2.4.0/debian/patches/force-keyword-mode.patch cvs2svn-2.4.0/de
+ non-empty value, then every end-of-line character sequence
diff -Nru cvs2svn-2.4.0/debian/patches/series cvs2svn-2.4.0/debian/patches/series
--- cvs2svn-2.4.0/debian/patches/series 2014-02-06 20:09:43.000000000 +0100
+++ cvs2svn-2.4.0/debian/patches/series 2014-06-25 11:00:40.000000000 +0200
@@ -1,2 +1,3 @@
+++ cvs2svn-2.4.0/debian/patches/series 2014-06-25 12:17:34.000000000 +0200
@@ -1,2 +1,4 @@
fix-co-dashv-obsolete.patch
update_gcs_email.patch
+force-keyword-mode.patch
+cvs-domain.patch
1 change: 1 addition & 0 deletions jupp-ncvs.cfg
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
source=/var/anoncvs/ncvs/contrib/code/jupp
domain=mirbsd.org
remote=/git/jupp-ncvs
prepend=/git/jupp-ocvs
set -A torm_branches -- tg
Expand Down
1 change: 1 addition & 0 deletions jupp-ocvs.cfg
Original file line number Diff line number Diff line change
@@ -1,3 +1,4 @@
source=/var/anoncvs/ocvs/contrib/code/jupp
domain=mirbsd.org
remote=/git/jupp-ocvs
set -A torm_branches -- tg
1 change: 1 addition & 0 deletions jupp.cfg
Original file line number Diff line number Diff line change
@@ -1,6 +1,7 @@
# /var/anoncvs/ocvs/contrib/code/jupp
# /var/anoncvs/ncvs/contrib/code/jupp
source=/var/anoncvs/cvs/contrib/code/jupp
domain=mirbsd.org
remote[email protected]:MirBSD/jupp.git
#remote=/git/jupp
prepend=/git/jupp-ncvs
Expand Down
1 change: 1 addition & 0 deletions mksh-ncvs.cfg
Original file line number Diff line number Diff line change
@@ -1,3 +1,4 @@
source=/var/anoncvs/ncvs/src/bin/ksh
domain=mirbsd.org
remote=/git/mksh-ncvs
prepend=/git/mksh-ocvs
1 change: 1 addition & 0 deletions mksh-ncvs2.cfg
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
source=/var/anoncvs/ncvs/ncvs2/ksh
domain=mirbsd.org
remote=/git/mksh-ncvs2
prepend=/git/mksh-ncvs
set -A torm_branches -- mirbsd
Expand Down
1 change: 1 addition & 0 deletions mksh-ocvs.cfg
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
source=/var/anoncvs/ocvs/src/bin/ksh
domain=mirbsd.org
remote=/git/mksh-ocvs
prepend=/git/mksh-pre-CVS
set -A torm_branches -- openbsd tg \
Expand Down
1 change: 1 addition & 0 deletions mksh-pre-CVS.cfg
Original file line number Diff line number Diff line change
@@ -1,2 +1,3 @@
source=/git/mksh-pre-CVS.src/symlinked
domain=mirbsd.org
remote=/git/mksh-pre-CVS
1 change: 1 addition & 0 deletions mksh.cfg
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,7 @@
# /var/anoncvs/ncvs/src/bin/ksh
# /var/anoncvs/ncvs/ncvs2/ksh
source=/var/anoncvs/cvs/src/bin/mksh
domain=mirbsd.org
remote[email protected]:MirBSD/mksh.git
#remote=/git/mksh
prepend=/git/mksh-ncvs2
Expand Down

0 comments on commit cfc8797

Please sign in to comment.