--- Begin Message ---
Package: cvs2svn
Version: 2.4.0-2
Severity: normal
Tags: patch upstream
Hi,
please consider applying the attached patches and pushing them upstream:
• force-keyword-mode.patch is to allow the git export of the
CVS repository to match a CVS export of it byte for byte,
when CVS keywords are used
• cvs-domain.patch is to add @domain.com parts to git-side
authors from CVS committers, assuming they all have their
CVS username as eMail localpart of the same domain (a rather
common setup when CVS is used over SSH, e.g. in modern BSD)
I rely on these patches for my automated git exports of parts
of MirBSD’s CVS repository to enable better publicity.
Thanks!
-- System Information:
Debian Release: 8.0
APT prefers unreleased
APT policy: (500, 'unreleased'), (500, 'buildd-unstable'), (500, 'unstable')
Architecture: x32 (x86_64)
Foreign Architectures: i386
Kernel: Linux 3.16.0-4-amd64 (SMP w/4 CPU cores)
Locale: LANG=C, LC_CTYPE=en_GB.UTF-8 (charmap=UTF-8)
Shell: /bin/sh linked to /bin/lksh
Init: sysvinit (via /sbin/init)
Versions of packages cvs2svn depends on:
ii python 2.7.8-4
ii rcs 5.9.3-1
ii subversion 1.8.10-5
Versions of packages cvs2svn recommends:
ii mime-support 3.58
Versions of packages cvs2svn suggests:
ii bzr 2.6.0+bzr6595-6
ii cvs 2:1.12.13+real-15
ii git [git-core] 1:2.1.4-2.1
-- no debconf information
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 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 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
@@ -0,0 +1,134 @@
+--- a/cvs2svn_lib/abstract_rcs_revision_manager.py
++++ b/cvs2svn_lib/abstract_rcs_revision_manager.py
+@@ -38,6 +38,9 @@ class AbstractRCSRevisionReader(Revision
+ # mode, which leaves the keywords untouched. Therefore, whenever
+ # eol_fix is False, we need to use '-kb' mode and then (if
+ # necessary) expand or collapse the keywords ourselves.
++ #
++ # The 'kept' substitution is an exception, we do not deal with
++ # keywords at all in this case and just let CVS do its thing.
+ _text_options = {
+ (False, 'collapsed') : (['-kb'], 'collapsed'),
+ (False, 'expanded') : (['-kb'], 'expanded'),
+@@ -46,6 +49,9 @@ class AbstractRCSRevisionReader(Revision
+ (True, 'collapsed') : (['-kk'], None),
+ (True, 'expanded') : (['-kkv'], None),
+ (True, 'untouched') : (['-ko'], None),
++
++ (False, 'kept') : ([], None),
++ (True, 'kept') : ([], None),
+ }
+
+ def get_pipe_command(self, cvs_rev, k_option):
+--- a/cvs2svn_lib/checkout_internal.py
++++ b/cvs2svn_lib/checkout_internal.py
+@@ -706,6 +706,9 @@ class InternalRevisionReader(RevisionRea
+ 'untouched' -- output keywords in the form they are found in
+ the RCS file
+
++ 'kept' -- output keywords in the form they are found in
++ the CVS checkout output
++
+ Note that $Log$ never actually generates a log (which makes test
+ 'requires_cvs()' fail).
+
+@@ -727,6 +730,9 @@ class InternalRevisionReader(RevisionRea
+ if keyword_handling == 'untouched':
+ # Leave keywords in the form that they were checked in.
+ pass
++ elif keyword_handling == 'kept':
++ # Leave keywords in the form they would have on checkout.
++ pass
+ elif keyword_handling == 'collapsed':
+ text = collapse_keywords(text)
+ elif keyword_handling == 'expanded':
+--- a/cvs2svn_lib/dvcs_common.py
++++ b/cvs2svn_lib/dvcs_common.py
+@@ -24,6 +24,7 @@ from cvs2svn_lib import config
+ from cvs2svn_lib.common import FatalError
+ from cvs2svn_lib.common import InternalError
+ from cvs2svn_lib.run_options import RunOptions
++from cvs2svn_lib.run_options import IncompatibleOption
+ from cvs2svn_lib.log import logger
+ from cvs2svn_lib.common import error_prefix
+ from cvs2svn_lib.context import Ctx
+@@ -50,9 +51,9 @@ class KeywordHandlingPropertySetter(File
+ propname = '_keyword_handling'
+
+ def __init__(self, value):
+- if value not in ['collapsed', 'expanded', 'untouched', None]:
++ if value not in ['collapsed', 'expanded', 'untouched', 'kept', None]:
+ raise FatalError(
+- 'Value for %s must be "collapsed", "expanded", or "untouched"'
++ 'Value for %s must be "collapsed", "expanded", "untouched", or "kept"'
+ % (self.propname,)
+ )
+ self.value = value
+@@ -69,6 +70,27 @@ class DVCSRunOptions(RunOptions):
+ Ctx().cross_branch_commits = False
+ RunOptions.__init__(self, progname, cmd_args, pass_manager)
+
++ def _get_extraction_options_group(self):
++ group = super(DVCSRunOptions, self)._get_extraction_options_group()
++ self.parser.set_default('force_keyword_mode', 'no')
++ group.add_option(IncompatibleOption(
++ '--force-keyword-mode', type='choice',
++ choices=['untouched', 'collapsed', 'expanded', 'kept', 'no'],
++ action='store',
++ help='force (untouched, collapsed, expanded, kept), or no',
++ man_help=(
++ 'Keyword mode to force, or \\fIno\\fR to use the default.'
++ '\\fIopt\\fR can be \'untouched\' (keep literally as they'
++ 'are recorded in the RCS file), \'collapsed\' (retain the'
++ 'key but not the value), \'expanded\' (fake the way CVS'
++ 'expands them, even for binaries), \'kept\' (just let CVS'
++ 'deal with keywords).'
++ ),
++ metavar='OPT',
++ ))
++
++ return group
++
+ def set_project(
+ self,
+ project_cvs_repos_path,
+@@ -100,9 +122,14 @@ class DVCSRunOptions(RunOptions):
+ def process_property_setter_options(self):
+ super(DVCSRunOptions, self).process_property_setter_options()
+
++ property_mode = self.options.force_keyword_mode
++ if property_mode == 'no':
++ # default
++ property_mode = 'collapsed'
++
+ # Property setters for internal use:
+ Ctx().file_property_setters.append(
+- KeywordHandlingPropertySetter('collapsed')
++ KeywordHandlingPropertySetter(property_mode)
+ )
+
+ def process_options(self):
+--- a/cvs2svn_lib/revision_manager.py
++++ b/cvs2svn_lib/revision_manager.py
+@@ -116,6 +116,8 @@ class RevisionReader(object):
+ *previous* revision, because CVS expands keywords on checkout,
+ not checkin.
+
++ * kept -- let CVS deal with keywords
++
+ * unset -- undefined behavior; depends on which revision manager
+ is being used.
+
+--- a/doc/properties.txt
++++ b/doc/properties.txt
+@@ -75,6 +75,10 @@ they are used for two purposes:
+ useful feature, but is listed for completeness. NOT
+ YET IMPLEMENTED.
+
++ 'kept' -- Just let CVS deal with the keywords, do not
++ handle them specially internally. This may conflict
++ with other options and should be used carefully.
++
+ _eol_fix -- Should end-of-line sequences be made uniform before
+ committing to the target VCS? If this property is set to a
+ 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 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
--- End Message ---