From ce2bd67d7fc0d2058ff6636414ee74bceefc5aea Mon Sep 17 00:00:00 2001 From: mhagger Date: Sat, 12 Jun 2010 09:39:01 +0000 Subject: [PATCH] Change CVSBinaryFileEOLStyleSetter into a FilePropertySetter. git-svn-id: http://cvs2svn.tigris.org/svn/cvs2svn/trunk@5151 be7e6eca-30d4-0310-a8e5-ac0d63af7087 --- cvs2bzr-example.options | 4 ++-- cvs2git-example.options | 4 ++-- cvs2hg-example.options | 4 ++-- cvs2svn-example.options | 4 ++-- cvs2svn_lib/property_setters.py | 10 +++++----- cvs2svn_lib/run_options.py | 2 +- 6 files changed, 14 insertions(+), 14 deletions(-) diff --git a/cvs2bzr-example.options b/cvs2bzr-example.options index d82a0160..a357caf6 100644 --- a/cvs2bzr-example.options +++ b/cvs2bzr-example.options @@ -363,12 +363,12 @@ ctx.file_property_setters.extend([ # specify a filename: #MimeMapper(r'/etc/mime.types', ignore_case=False), - ]) -ctx.revision_property_setters.extend([ # Omit the svn:eol-style property from any files that are listed # as binary (i.e., mode '-kb') in CVS: CVSBinaryFileEOLStyleSetter(), + ]) +ctx.revision_property_setters.extend([ # If the file is binary and its svn:mime-type property is not yet # set, set svn:mime-type to 'application/octet-stream'. CVSBinaryFileDefaultMimeTypeSetter(), diff --git a/cvs2git-example.options b/cvs2git-example.options index ca779b5a..1db93758 100644 --- a/cvs2git-example.options +++ b/cvs2git-example.options @@ -398,12 +398,12 @@ ctx.file_property_setters.extend([ # specify a filename: #MimeMapper(r'/etc/mime.types', ignore_case=False), - ]) -ctx.revision_property_setters.extend([ # Omit the svn:eol-style property from any files that are listed # as binary (i.e., mode '-kb') in CVS: CVSBinaryFileEOLStyleSetter(), + ]) +ctx.revision_property_setters.extend([ # If the file is binary and its svn:mime-type property is not yet # set, set svn:mime-type to 'application/octet-stream'. CVSBinaryFileDefaultMimeTypeSetter(), diff --git a/cvs2hg-example.options b/cvs2hg-example.options index c83561f9..baadc6d2 100644 --- a/cvs2hg-example.options +++ b/cvs2hg-example.options @@ -359,12 +359,12 @@ ctx.file_property_setters.extend([ # specify a filename: #MimeMapper(r'/etc/mime.types', ignore_case=False), - ]) -ctx.revision_property_setters.extend([ # Omit the svn:eol-style property from any files that are listed # as binary (i.e., mode '-kb') in CVS: CVSBinaryFileEOLStyleSetter(), + ]) +ctx.revision_property_setters.extend([ # If the file is binary and its svn:mime-type property is not yet # set, set svn:mime-type to 'application/octet-stream'. CVSBinaryFileDefaultMimeTypeSetter(), diff --git a/cvs2svn-example.options b/cvs2svn-example.options index a2269777..1210d446 100644 --- a/cvs2svn-example.options +++ b/cvs2svn-example.options @@ -460,12 +460,12 @@ ctx.file_property_setters.extend([ # specify a filename: #MimeMapper(r'/etc/mime.types', ignore_case=False), - ]) -ctx.revision_property_setters.extend([ # Omit the svn:eol-style property from any files that are listed # as binary (i.e., mode '-kb') in CVS: CVSBinaryFileEOLStyleSetter(), + ]) +ctx.revision_property_setters.extend([ # If the file is binary and its svn:mime-type property is not yet # set, set svn:mime-type to 'application/octet-stream'. CVSBinaryFileDefaultMimeTypeSetter(), diff --git a/cvs2svn_lib/property_setters.py b/cvs2svn_lib/property_setters.py index 1450370a..1717bb32 100644 --- a/cvs2svn_lib/property_setters.py +++ b/cvs2svn_lib/property_setters.py @@ -100,17 +100,17 @@ class DescriptionPropertySetter(RevisionPropertySetter): s_item.svn_props[self.propname] = s_item.cvs_rev.cvs_file.description -class CVSBinaryFileEOLStyleSetter(RevisionPropertySetter): +class CVSBinaryFileEOLStyleSetter(FilePropertySetter): """Set the eol-style to None for files with CVS mode '-kb'.""" propname = 'svn:eol-style' - def set_properties(self, s_item): - if self.propname in s_item.svn_props: + def set_properties(self, cvs_file): + if self.propname in cvs_file.properties: return - if s_item.cvs_rev.cvs_file.mode == 'b': - s_item.svn_props[self.propname] = None + if cvs_file.mode == 'b': + cvs_file.properties[self.propname] = None class MimeMapper(FilePropertySetter): diff --git a/cvs2svn_lib/run_options.py b/cvs2svn_lib/run_options.py index 9ec34219..cb0b0bd7 100644 --- a/cvs2svn_lib/run_options.py +++ b/cvs2svn_lib/run_options.py @@ -1034,7 +1034,7 @@ class RunOptions(object): for value in options.mime_types_files: ctx.file_property_setters.append(MimeMapper(value)) - ctx.revision_property_setters.append(CVSBinaryFileEOLStyleSetter()) + ctx.file_property_setters.append(CVSBinaryFileEOLStyleSetter()) ctx.revision_property_setters.append(CVSBinaryFileDefaultMimeTypeSetter()) -- 2.11.4.GIT