Re: cvs2svn: Excluding CVS folders

David Morris <[email protected]> Sat, 20 Apr 2013 01:29:55 -0400
Newsgroups gmane.comp.version-control.subversion.cvs2svn.user
Message-ID <CAJ5t5KYUpxeoW-sZN3O3HQ_wvqMs3uJjMo1CraXw14BJh2RtmA@mail.gmail.com>
Here you go.  Again, I have not yet tried the command-line option
other than to see that it prints out the help.  All of our conversions
are options file driven so that's the only testing I've done.

David


On Sat, Apr 20, 2013 at 12:34 AM, Michael Haggerty <[email protected]> wrote:
> On 04/20/2013 06:30 AM, Michael Haggerty wrote:
>> On 04/19/2013 07:51 PM, David Morris wrote:
>>> At any rate, I've added the option to filter them if anyone wants the patch.
>>
>> I wanted to make sure we wouldn't be crufting up the code with a
>> workaround for a one-time accident.  But given that the directories are
>> created by CVS, it is clear that others will also confront the same
>> problem.  I will integrate this change as soon as I have time to review
>> your patch.
>
> David,
>
> I forgot that you haven't sent the patch to the mailing list yet.
> Please do so, assuming you are willing to contribute it under our license.
>
> Thanks,
> Michael
>
> --
> Michael Haggerty
> [email protected]
> http://softwareswirl.blogspot.com/

------------------------------------------------------
http://cvs2svn.tigris.org/ds/viewMessage.do?dsForumId=1670&dsMessageId=3053801

To unsubscribe from this discussion, e-mail: [[email protected]].
cvs2svn-2.4.0-nocvsdirs.patch (application/octet-stream, 3.3 KB)
diff -x '*.pyc' -Naur cvs2svn-2.4.0/cvs2svn-example.options cvs2svn-2.4.0-patched/cvs2svn-example.options
--- cvs2svn-2.4.0/cvs2svn-example.options	2012-09-22 02:49:56.000000000 -0400
+++ cvs2svn-2.4.0-patched/cvs2svn-example.options	2013-04-19 14:39:49.656398966 -0400
@@ -562,6 +562,14 @@
 # output, change this option to True:
 ctx.keep_cvsignore = False
 
+# CVS creates a 'CVS' directory in every repository directory.
+# These directories contain data files used to associate workspace
+# files with repositories.  By default, cvs2svn will migrate these
+# CVS directories, despite them being useless for SVN purposes.
+# Setting this option to True causes all directories named 'CVS' to 
+# be excluded from the migration.
+ctx.exclude_cvs_directories = False
+
 # By default, it is a fatal error for a CVS ",v" file to appear both
 # inside and outside of an "Attic" subdirectory (this should never
 # happen, but frequently occurs due to botched repository
diff -x '*.pyc' -Naur cvs2svn-2.4.0/cvs2svn_lib/context.py cvs2svn-2.4.0-patched/cvs2svn_lib/context.py
--- cvs2svn-2.4.0/cvs2svn_lib/context.py	2012-01-27 07:55:10.000000000 -0500
+++ cvs2svn-2.4.0-patched/cvs2svn_lib/context.py	2013-04-19 14:39:50.043089865 -0400
@@ -63,6 +63,7 @@
     self.cross_project_commits = True
     self.cross_branch_commits = True
     self.retain_conflicting_attic_files = False
+    self.exclude_cvs_directories = False
 
     # textwrap.TextWrapper instance to be used for wrapping log messages:
     self.text_wrapper = textwrap.TextWrapper(width=76, break_long_words=False)
diff -x '*.pyc' -Naur cvs2svn-2.4.0/cvs2svn_lib/repository_walker.py cvs2svn-2.4.0-patched/cvs2svn_lib/repository_walker.py
--- cvs2svn-2.4.0/cvs2svn_lib/repository_walker.py	2012-01-27 07:55:10.000000000 -0500
+++ cvs2svn-2.4.0-patched/cvs2svn_lib/repository_walker.py	2013-04-19 14:39:49.930618024 -0400
@@ -212,7 +212,7 @@
       elif os.path.isdir(pathname):
         if fname == 'Attic':
           attic_dir = fname
-        elif fname == '.svn':
+        elif fname == '.svn' or (Ctx().exclude_cvs_directories and fname == 'CVS'):
           logger.debug("Directory %s ignored" % (pathname,))
         else:
           dirs.append(fname)
diff -x '*.pyc' -Naur cvs2svn-2.4.0/cvs2svn_lib/run_options.py cvs2svn-2.4.0-patched/cvs2svn_lib/run_options.py
--- cvs2svn-2.4.0/cvs2svn_lib/run_options.py	2012-01-27 07:55:10.000000000 -0500
+++ cvs2svn-2.4.0-patched/cvs2svn_lib/run_options.py	2013-04-19 14:39:49.984530160 -0400
@@ -369,6 +369,21 @@
             'error.)'
             ),
         ))
+    group.add_option(ContextOption(
+        '--exclude-cvs-directories',
+        action='store_true',
+        help=(
+            'ignores all CVS directories from the CVS repository.'
+            ),
+        man_help=(
+            'CVS creates a \'CVS\' directory in every repository directory. '
+            'These directories contain data files used to associate workspace '
+            'files with repositories.  By default, cvs2svn will migrate these '
+            'CVS directories, despite them being useless for SVN purposes.  '
+            'This option causes all directories named \'CVS\' to be excluded '
+            'from the migration.'
+            ),
+        ))
 
     return group