www/cvs2git.html: Add instructions for converting into a non-bare repository.
[cvs2svn.git] / cvs2svn-example.options
blob3a8cea06b45d196262dcf36b777584ceb46e5842
1 # (Be in -*- mode: python; coding: utf-8 -*- mode.)
3 # ====================================================================
4 # Copyright (c) 2006-2009 CollabNet.  All rights reserved.
6 # This software is licensed as described in the file COPYING, which
7 # you should have received as part of this distribution.  The terms
8 # are also available at http://subversion.tigris.org/license-1.html.
9 # If newer versions of this license are posted there, you may use a
10 # newer version instead, at your option.
12 # This software consists of voluntary contributions made by many
13 # individuals.  For exact contribution history, see the revision
14 # history and logs, available at http://cvs2svn.tigris.org/.
15 # ====================================================================
17 #                  #####################
18 #                  ## PLEASE READ ME! ##
19 #                  #####################
21 # This is a template for an options file that can be used to configure
22 # cvs2svn.  Many options do not have defaults, so it is easier to copy
23 # this file and modify what you need rather than creating a new
24 # options file from scratch.
26 # This file is in Python syntax, but you don't need to know Python to
27 # modify it.  But if you *do* know Python, then you will be happy to
28 # know that you can use arbitary Python constructs to do fancy
29 # configuration tricks.
31 # But please be aware of the following:
33 # * In many places, leading whitespace is significant in Python (it is
34 #   used instead of curly braces to group statements together).
35 #   Therefore, if you don't know what you are doing, it is best to
36 #   leave the whitespace as it is.
38 # * In normal strings, Python treats a backslash ("\") as an escape
39 #   character.  Therefore, if you want to specify a string that
40 #   contains a backslash, you need either to escape the backslash with
41 #   another backslash ("\\"), or use a "raw string", as in one if the
42 #   following equivalent examples:
44 #       cvs_executable = 'c:\\windows\\system32\\cvs.exe'
45 #       cvs_executable = r'c:\windows\system32\cvs.exe'
47 #   See http://docs.python.org/tutorial/introduction.html#strings for
48 #   more information.
50 # Two identifiers will have been defined before this file is executed,
51 # and can be used freely within this file:
53 #     ctx -- a Ctx object (see cvs2svn_lib/context.py), which holds
54 #         many configuration options
56 #     run_options -- an instance of the SVNRunOptions class (see
57 #         cvs2svn_lib/svn_run_options.py), which holds some variables
58 #         governing how cvs2svn is run
61 # Import some modules that are used in setting the options:
62 from cvs2svn_lib import config
63 from cvs2svn_lib import changeset_database
64 from cvs2svn_lib.common import CVSTextDecoder
65 from cvs2svn_lib.log import logger
66 from cvs2svn_lib.svn_output_option import DumpfileOutputOption
67 from cvs2svn_lib.svn_output_option import ExistingRepositoryOutputOption
68 from cvs2svn_lib.svn_output_option import NewRepositoryOutputOption
69 from cvs2svn_lib.svn_run_options import SVNEOLFixPropertySetter
70 from cvs2svn_lib.svn_run_options import SVNKeywordHandlingPropertySetter
71 from cvs2svn_lib.revision_manager import NullRevisionCollector
72 from cvs2svn_lib.rcs_revision_manager import RCSRevisionReader
73 from cvs2svn_lib.cvs_revision_manager import CVSRevisionReader
74 from cvs2svn_lib.checkout_internal import InternalRevisionCollector
75 from cvs2svn_lib.checkout_internal import InternalRevisionReader
76 from cvs2svn_lib.symbol_strategy import AllBranchRule
77 from cvs2svn_lib.symbol_strategy import AllTagRule
78 from cvs2svn_lib.symbol_strategy import BranchIfCommitsRule
79 from cvs2svn_lib.symbol_strategy import ExcludeRegexpStrategyRule
80 from cvs2svn_lib.symbol_strategy import ForceBranchRegexpStrategyRule
81 from cvs2svn_lib.symbol_strategy import ForceTagRegexpStrategyRule
82 from cvs2svn_lib.symbol_strategy import ExcludeTrivialImportBranchRule
83 from cvs2svn_lib.symbol_strategy import ExcludeVendorBranchRule
84 from cvs2svn_lib.symbol_strategy import HeuristicStrategyRule
85 from cvs2svn_lib.symbol_strategy import UnambiguousUsageRule
86 from cvs2svn_lib.symbol_strategy import HeuristicPreferredParentRule
87 from cvs2svn_lib.symbol_strategy import SymbolHintsFileRule
88 from cvs2svn_lib.symbol_transform import ReplaceSubstringsSymbolTransform
89 from cvs2svn_lib.symbol_transform import RegexpSymbolTransform
90 from cvs2svn_lib.symbol_transform import IgnoreSymbolTransform
91 from cvs2svn_lib.symbol_transform import NormalizePathsSymbolTransform
92 from cvs2svn_lib.property_setters import AutoPropsPropertySetter
93 from cvs2svn_lib.property_setters import CVSBinaryFileDefaultMimeTypeSetter
94 from cvs2svn_lib.property_setters import CVSBinaryFileEOLStyleSetter
95 from cvs2svn_lib.property_setters import CVSRevisionNumberSetter
96 from cvs2svn_lib.property_setters import DefaultEOLStyleSetter
97 from cvs2svn_lib.property_setters import EOLStyleFromMimeTypeSetter
98 from cvs2svn_lib.property_setters import ExecutablePropertySetter
99 from cvs2svn_lib.property_setters import DescriptionPropertySetter
100 from cvs2svn_lib.property_setters import KeywordsPropertySetter
101 from cvs2svn_lib.property_setters import MimeMapper
102 from cvs2svn_lib.property_setters import SVNBinaryFileKeywordsPropertySetter
104 # To choose the level of logging output, uncomment one of the
105 # following lines:
106 #logger.log_level = logger.WARN
107 #logger.log_level = logger.QUIET
108 logger.log_level = logger.NORMAL
109 #logger.log_level = logger.VERBOSE
110 #logger.log_level = logger.DEBUG
113 # The directory to use for temporary files:
114 ctx.tmpdir = r'cvs2svn-tmp'
116 # author_transforms can be used to map CVS author names (e.g.,
117 # "jrandom") to whatever names make sense for your SVN configuration
118 # (e.g., "john.j.random").  All values should be either Unicode
119 # strings (i.e., with "u" as a prefix) or 8-bit strings in the utf-8
120 # encoding.  To use this feature, please substitute your own project's
121 # usernames here and uncomment the author_transforms option when
122 # setting ctx.output_option below
123 author_transforms={
124     'jrandom' : u'john.j.random',
125     'brane' : u'Branko.Čibej',
126     'ringstrom' : 'ringström',
127     'dionisos' : u'e.hülsmann',
128     }
130 # There are several possible options for where to put the output of a
131 # cvs2svn conversion.  Please choose one of the following and adjust
132 # the parameters as necessary:
134 # Use this output option if you would like cvs2svn to create a new SVN
135 # repository and store the converted repository there.  The first
136 # argument is the path to which the repository should be written (this
137 # repository must not already exist).  The (optional) fs_type argument
138 # allows a --fs-type option to be passed to "svnadmin create".  The
139 # (optional) bdb_txn_nosync argument can be specified to set the
140 # --bdb-txn-nosync option on a bdb repository.  The (optional)
141 # create_options argument can be specified to set a list of verbatim
142 # options to be passed to "svnadmin create".  The (optional)
143 # author_transforms argument allows CVS author names to be transformed
144 # arbitrarily into SVN author names (as described above):
145 ctx.output_option = NewRepositoryOutputOption(
146     r'/path/to/svnrepo',
147     #fs_type='fsfs',
148     #bdb_txn_nosync=False,
149     #create_options=['--pre-1.5-compatible'],
150     #author_transforms=author_transforms,
151     )
153 # Use this output option if you would like cvs2svn to store the
154 # converted CVS repository into an SVN repository that already exists.
155 # The first argument is the filesystem path of an existing local SVN
156 # repository (this repository must already exist).  The
157 # author_transforms option is as described above:
158 #ctx.output_option = ExistingRepositoryOutputOption(
159 #    r'/path/to/svnrepo', # Path to repository
160 #    #author_transforms=author_transforms,
161 #    )
163 # Use this type of output option if you want the output of the
164 # conversion to be written to a SVN dumpfile instead of committing
165 # them into an actual repository.  The author_transforms option is as
166 # described above:
167 #ctx.output_option = DumpfileOutputOption(
168 #    dumpfile_path=r'/path/to/cvs2svn-dump', # Name of dumpfile to create
169 #    #author_transforms=author_transforms,
170 #    )
173 # Independent of the ctx.output_option selected, the following option
174 # can be set to True to suppress cvs2svn output altogether:
175 ctx.dry_run = False
177 # The following set of options specifies how the revision contents of
178 # the RCS files should be read.
180 # The default selection is InternalRevisionReader, which uses built-in
181 # code that reads the RCS deltas while parsing the files in
182 # CollectRevsPass.  This method is very fast but requires lots of
183 # temporary disk space.  The disk space is required for (1) storing
184 # all of the RCS deltas, and (2) during OutputPass, keeping a copy of
185 # the full text of every revision that still has a descendant that
186 # hasn't yet been committed.  Since this can includes multiple
187 # revisions of each file (i.e., on multiple branches), the required
188 # amount of temporary space can potentially be many times the size of
189 # a checked out copy of the whole repository.  Setting compress=True
190 # cuts the disk space requirements by about 50% at the price of
191 # increased CPU usage.  Using compression usually speeds up the
192 # conversion due to the reduced I/O pressure, unless --tmpdir is on a
193 # RAM disk.  This method does not expand CVS's "Log" keywords.
195 # The second possibility is RCSRevisionReader, which uses RCS's "co"
196 # program to extract the revision contents of the RCS files during
197 # OutputPass.  This option doesn't require any temporary space, but it
198 # is relatively slow because (1) "co" has to be executed very many
199 # times; and (2) "co" itself has to assemble many file deltas to
200 # compute the contents of a particular revision.  The constructor
201 # argument specifies how to invoke the "co" executable.
203 # The third possibility is CVSRevisionReader, which uses the "cvs"
204 # program to extract the revision contents out of the RCS files during
205 # OutputPass.  This option doesn't require any temporary space, but it
206 # is the slowest of all, because "cvs" is considerably slower than
207 # "co".  However, it works in some situations where RCSRevisionReader
208 # fails; see the HTML documentation of the "--use-cvs" option for
209 # details.  The constructor argument specifies how to invoke the "co"
210 # executable.
212 # Choose one of the following three groups of lines:
213 ctx.revision_collector = InternalRevisionCollector(compress=True)
214 ctx.revision_reader = InternalRevisionReader(compress=True)
216 #ctx.revision_collector = NullRevisionCollector()
217 #ctx.revision_reader = RCSRevisionReader(co_executable=r'co')
219 #ctx.revision_collector = NullRevisionCollector()
220 #ctx.revision_reader = CVSRevisionReader(cvs_executable=r'cvs')
222 # Set the name (and optionally the path) to the 'svnadmin' command,
223 # which is needed for NewRepositoryOutputOption or
224 # ExistingRepositoryOutputOption.  The default is the "svnadmin"
225 # command in the user's PATH:
226 #ctx.svnadmin_executable = r'svnadmin'
228 # Change the following line to True if the conversion should only
229 # include the trunk of the repository (i.e., all branches and tags
230 # should be ignored):
231 ctx.trunk_only = False
233 # Normally, cvs2svn ignores directories within the CVS repository if
234 # they do not contain valid RCS files.  This produces a Subversion
235 # repository whose behavior imitates that of CVS if CVS is typically
236 # used with the "-P" option.  However, sometimes these empty
237 # directories are needed by a project (e.g., by the build procedure).
238 # If so, the following option can be sent to True to cause empty
239 # directories to be created in the SVN repository when their parent
240 # directory is created and removed when their parent directory is
241 # removed.  (This is more likely to be useful than the behavior of CVS
242 # when its "-P" option is not used.)
243 ctx.include_empty_directories = False
245 # Normally, cvs2svn deletes a directory once the last file has been
246 # deleted from it (a la "cvs -P").  Change the following line to False
247 # if you would like such directories to be retained in the Subversion
248 # repository through the rest of history:
249 ctx.prune = True
251 # How to convert author names, log messages, and filenames to Unicode.
252 # The first argument to CVSTextDecoder is a list of encoders that are
253 # tried in order in 'strict' mode until one of them succeeds.  If none
254 # of those succeeds, then fallback_encoder is used in lossy 'replace'
255 # mode (if it is specified).  Setting a fallback encoder ensures that
256 # the encoder always succeeds, but it can cause information loss.
257 ctx.cvs_author_decoder = CVSTextDecoder(
258     [
259         #'utf8',
260         #'latin1',
261         'ascii',
262         ],
263     #fallback_encoding='ascii'
264     )
265 ctx.cvs_log_decoder = CVSTextDecoder(
266     [
267         #'utf8',
268         #'latin1',
269         'ascii',
270         ],
271     #fallback_encoding='ascii',
272     eol_fix='\n',
273     )
274 # You might want to be especially strict when converting filenames to
275 # Unicode (e.g., maybe not specify a fallback_encoding).
276 ctx.cvs_filename_decoder = CVSTextDecoder(
277     [
278         #'utf8',
279         #'latin1',
280         'ascii',
281         ],
282     #fallback_encoding='ascii'
283     )
285 # Template for the commit message to be used for initial project
286 # commits.
287 ctx.initial_project_commit_message = (
288     'Standard project directories initialized by cvs2svn.'
289     )
291 # Template for the commit message to be used for post commits, in
292 # which modifications to a vendor branch are copied back to trunk.
293 # This message can use '%(revnum)d' to include the revision number of
294 # the revision that included the change to the vendor branch.
295 ctx.post_commit_message = (
296     'This commit was generated by cvs2svn to compensate for '
297     'changes in r%(revnum)d, which included commits to RCS files '
298     'with non-trunk default branches.'
299     )
301 # Template for the commit message to be used for commits in which
302 # symbols are created.  This message can use '%(symbol_type)s' to
303 # include the type of the symbol ('branch' or 'tag') or
304 # '%(symbol_name)s' to include the name of the symbol.
305 ctx.symbol_commit_message = (
306     "This commit was manufactured by cvs2svn to create %(symbol_type)s "
307     "'%(symbol_name)s'."
308     )
310 # Some CVS clients for MacOS store resource fork data into CVS along
311 # with the file contents itself by wrapping it all up in a container
312 # format called "AppleSingle".  Subversion currently does not support
313 # MacOS resource forks.  Nevertheless, sometimes the resource fork
314 # information is not necessary and can be discarded.  Set the
315 # following option to True if you would like cvs2svn to identify files
316 # whose contents are encoded in AppleSingle format, and discard all
317 # but the data fork for such files before committing them to
318 # Subversion.  (Please note that AppleSingle contents are identified
319 # by the AppleSingle magic number as the first four bytes of the file.
320 # This check is not failproof, so only set this option if you think
321 # you need it.)
322 ctx.decode_apple_single = False
324 # This option can be set to the name of a filename to which are stored
325 # statistics and conversion decisions about the CVS symbols.
326 ctx.symbol_info_filename = None
327 #ctx.symbol_info_filename = 'symbol-info.txt'
329 # cvs2svn uses "symbol strategy rules" to help decide how to handle
330 # CVS symbols.  The rules in a project's symbol_strategy_rules are
331 # applied in order, and each rule is allowed to modify the symbol.
332 # The result (after each of the rules has been applied) is used for
333 # the conversion.
335 # 1. A CVS symbol might be used as a tag in one file and as a branch
336 #    in another file.  cvs2svn has to decide whether to convert such a
337 #    symbol as a tag or as a branch.  cvs2svn uses a series of
338 #    heuristic rules to decide how to convert a symbol.  The user can
339 #    override the default rules for specific symbols or symbols
340 #    matching regular expressions.
342 # 2. cvs2svn is also capable of excluding symbols from the conversion
343 #    (provided no other symbols depend on them.
345 # 3. CVS does not record unambiguously the line of development from
346 #    which a symbol sprouted.  cvs2svn uses a heuristic to choose a
347 #    symbol's "preferred parents".
349 # The standard branch/tag/exclude StrategyRules do not change a symbol
350 # that has already been processed by an earlier rule, so in effect the
351 # first matching rule is the one that is used.
353 global_symbol_strategy_rules = [
354     # It is possible to specify manually exactly how symbols should be
355     # converted and what line of development should be used as the
356     # preferred parent.  To do so, create a file containing the symbol
357     # hints and enable the following option.
358     #
359     # The format of the hints file is described in the documentation
360     # for the SymbolHintsFileRule class in
361     # cvs2svn_lib/symbol_strategy.py.  The file output by the
362     # --write-symbol-info (i.e., ctx.symbol_info_filename) option is
363     # in the same format.  The simplest way to use this option is to
364     # run the conversion through CollateSymbolsPass with
365     # --write-symbol-info option, copy the symbol info and edit it to
366     # create a hints file, then re-start the conversion at
367     # CollateSymbolsPass with this option enabled.
368     #SymbolHintsFileRule('symbol-hints.txt'),
370     # To force all symbols matching a regular expression to be
371     # converted as branches, add rules like the following:
372     #ForceBranchRegexpStrategyRule(r'branch.*'),
374     # To force all symbols matching a regular expression to be
375     # converted as tags, add rules like the following:
376     #ForceTagRegexpStrategyRule(r'tag.*'),
378     # To force all symbols matching a regular expression to be
379     # excluded from the conversion, add rules like the following:
380     #ExcludeRegexpStrategyRule(r'unknown-.*'),
382     # Sometimes people use "cvs import" to get their own source code
383     # into CVS.  This practice creates a vendor branch 1.1.1 and
384     # imports the code onto the vendor branch as 1.1.1.1, then copies
385     # the same content to the trunk as version 1.1.  Normally, such
386     # vendor branches are useless and they complicate the SVN history
387     # unnecessarily.  The following rule excludes any branches that
388     # only existed as a vendor branch with a single import (leaving
389     # only the 1.1 revision).  If you want to retain such branches,
390     # comment out the following line.  (Please note that this rule
391     # does not exclude vendor *tags*, as they are not so easy to
392     # identify.)
393     ExcludeTrivialImportBranchRule(),
395     # To exclude all vendor branches (branches that had "cvs import"s
396     # on them but no other kinds of commits), uncomment the following
397     # line:
398     #ExcludeVendorBranchRule(),
400     # Usually you want this rule, to convert unambiguous symbols
401     # (symbols that were only ever used as tags or only ever used as
402     # branches in CVS) the same way they were used in CVS:
403     UnambiguousUsageRule(),
405     # If there was ever a commit on a symbol, then it cannot be
406     # converted as a tag.  This rule causes all such symbols to be
407     # converted as branches.  If you would like to resolve such
408     # ambiguities manually, comment out the following line:
409     BranchIfCommitsRule(),
411     # Last in the list can be a catch-all rule that is used for
412     # symbols that were not matched by any of the more specific rules
413     # above.  (Assuming that BranchIfCommitsRule() was included above,
414     # then the symbols that are still indeterminate at this point can
415     # sensibly be converted as branches or tags.)  Include at most one
416     # of these lines.  If none of these catch-all rules are included,
417     # then the presence of any ambiguous symbols (that haven't been
418     # disambiguated above) is an error:
420     # Convert ambiguous symbols based on whether they were used more
421     # often as branches or as tags:
422     HeuristicStrategyRule(),
423     # Convert all ambiguous symbols as branches:
424     #AllBranchRule(),
425     # Convert all ambiguous symbols as tags:
426     #AllTagRule(),
428     # The last rule is here to choose the preferred parent of branches
429     # and tags, that is, the line of development from which the symbol
430     # sprouts.
431     HeuristicPreferredParentRule(),
432     ]
434 # Specify a username to be used for commits generated by cvs2svn.  If
435 # this option is set to None then no username will be used for such
436 # commits:
437 ctx.username = None
438 #ctx.username = 'cvs2svn'
440 # ctx.file_property_setters and ctx.revision_property_setters contain
441 # rules used to set the svn properties on files in the converted
442 # archive.  For each file, the rules are tried one by one.  Any rule
443 # can add or suppress one or more svn properties.  Typically the rules
444 # will not overwrite properties set by a previous rule (though they
445 # are free to do so).  ctx.file_property_setters should be used for
446 # properties that remain the same for the life of the file; these
447 # should implement FilePropertySetter.  ctx.revision_property_setters
448 # should be used for properties that are allowed to vary from revision
449 # to revision; these should implement RevisionPropertySetter.
450 ctx.file_property_setters.extend([
451     # To read auto-props rules from a file, uncomment the following line
452     # and specify a filename.  The boolean argument specifies whether
453     # case should be ignored when matching filenames to the filename
454     # patterns found in the auto-props file:
455     #AutoPropsPropertySetter(
456     #    r'/home/username/.subversion/config',
457     #    ignore_case=True,
458     #    ),
460     # To read mime types from a file and use them to set svn:mime-type
461     # based on the filename extensions, uncomment the following line
462     # and specify a filename (see
463     # http://en.wikipedia.org/wiki/Mime.types for information about
464     # mime.types files):
465     #MimeMapper(r'/etc/mime.types', ignore_case=False),
467     # Omit the svn:eol-style property from any files that are listed
468     # as binary (i.e., mode '-kb') in CVS:
469     CVSBinaryFileEOLStyleSetter(),
471     # If the file is binary and its svn:mime-type property is not yet
472     # set, set svn:mime-type to 'application/octet-stream'.
473     CVSBinaryFileDefaultMimeTypeSetter(),
475     # To try to determine the eol-style from the mime type, uncomment
476     # the following line:
477     #EOLStyleFromMimeTypeSetter(),
479     # Choose one of the following lines to set the default
480     # svn:eol-style if none of the above rules applied.  The argument
481     # is the svn:eol-style that should be applied, or None if no
482     # svn:eol-style should be set (i.e., the file should be treated as
483     # binary).
484     #
485     # The default is to treat all files as binary unless one of the
486     # previous rules has determined otherwise, because this is the
487     # safest approach.  However, if you have been diligent about
488     # marking binary files with -kb in CVS and/or you have used the
489     # above rules to definitely mark binary files as binary, then you
490     # might prefer to use 'native' as the default, as it is usually
491     # the most convenient setting for text files.  Other possible
492     # options: 'CRLF', 'CR', 'LF'.
493     DefaultEOLStyleSetter(None),
494     #DefaultEOLStyleSetter('native'),
496     # Prevent svn:keywords from being set on files that have
497     # svn:eol-style unset.
498     SVNBinaryFileKeywordsPropertySetter(),
500     # If svn:keywords has not been set yet, set it based on the file's
501     # CVS mode:
502     KeywordsPropertySetter(config.SVN_KEYWORDS_VALUE),
504     # Set the svn:executable flag on any files that are marked in CVS as
505     # being executable:
506     ExecutablePropertySetter(),
508     # Set the cvs:description property to the CVS description of any
509     # file that has one:
510     DescriptionPropertySetter(propname='cvs:description'),
512     # The following is for internal use.  It determines how to handle
513     # keywords in the text being committed:
514     SVNKeywordHandlingPropertySetter(),
516     # The following is for internal use.  It determines how to munge
517     # EOL sequences based on how the svn:eol-style property is set.
518     SVNEOLFixPropertySetter(),
520     ])
521 ctx.revision_property_setters.extend([
522     # Uncomment the following line to include the original CVS revision
523     # numbers as file properties in the SVN archive:
524     #CVSRevisionNumberSetter(propname='cvs2svn:cvs-rev'),
526     ])
528 # To skip the cleanup of temporary files, uncomment the following
529 # option:
530 #ctx.skip_cleanup = True
533 # In CVS, it is perfectly possible to make a single commit that
534 # affects more than one project or more than one branch of a single
535 # project.  Subversion also allows such commits.  Therefore, by
536 # default, when cvs2svn sees what looks like a cross-project or
537 # cross-branch CVS commit, it converts it into a
538 # cross-project/cross-branch Subversion commit.
540 # However, other tools and SCMs have trouble representing
541 # cross-project or cross-branch commits.  (For example, Trac's Revtree
542 # plugin, http://www.trac-hacks.org/wiki/RevtreePlugin is confused by
543 # such commits.)  Therefore, we provide the following two options to
544 # allow cross-project/cross-branch commits to be suppressed.
546 # To prevent CVS commits from different projects from being merged
547 # into single SVN commits, change this option to False:
548 ctx.cross_project_commits = True
550 # To prevent CVS commits on different branches from being merged into
551 # single SVN commits, change this option to False:
552 ctx.cross_branch_commits = True
554 # By default, .cvsignore files are rendered in the output by setting
555 # corresponding svn:ignore properties on the parent directory, but the
556 # .cvsignore files themselves are not included in the conversion
557 # output.  If you would like to include the .cvsignore files in the
558 # output, change this option to True:
559 ctx.keep_cvsignore = False
561 # By default, it is a fatal error for a CVS ",v" file to appear both
562 # inside and outside of an "Attic" subdirectory (this should never
563 # happen, but frequently occurs due to botched repository
564 # administration).  If you would like to retain both versions of such
565 # files, change the following option to True, and the attic version of
566 # the file will be left in an SVN subdirectory called "Attic":
567 ctx.retain_conflicting_attic_files = False
569 # Now use stanzas like the following to define CVS projects that
570 # should be converted.  The arguments are:
572 # - The filesystem path of the project within the CVS repository.
574 # - The path that should be used for the "trunk" directory of this
575 #   project within the SVN repository.  This is an SVN path, so it
576 #   should always use forward slashes ("/").
578 # - The path that should be used for the "branches" directory of this
579 #   project within the SVN repository.  This is an SVN path, so it
580 #   should always use forward slashes ("/").
582 # - The path that should be used for the "tags" directory of this
583 #   project within the SVN repository.  This is an SVN path, so it
584 #   should always use forward slashes ("/").
586 # - A list of symbol transformations that can be used to rename
587 #   symbols in this project.  Each entry is a tuple (pattern,
588 #   replacement), where pattern is a Python regular expression pattern
589 #   and replacement is the text that should replace the pattern.  Each
590 #   pattern is matched against each symbol name.  If the pattern
591 #   matches, then it is replaced with the corresponding replacement
592 #   text.  The replacement can include substitution patterns (e.g.,
593 #   r'\1' or r'\g<name>').  Typically you will want to use raw strings
594 #   (strings with a preceding 'r', like shown in the examples) for the
595 #   regexp and its replacement to avoid backslash substitution within
596 #   those strings.
599 # Create the default project (using ctx.trunk, ctx.branches, and ctx.tags):
600 run_options.add_project(
601     r'test-data/main-cvsrepos',
602     trunk_path='trunk',
603     branches_path='branches',
604     tags_path='tags',
605     initial_directories=[
606         # The project's trunk_path, branches_path, and tags_path
607         # directories are added to the SVN repository in the project's
608         # first commit.  If you would like additional SVN directories
609         # to be created in the project's first commit, list them here:
610         #'releases',
611         ],
612     symbol_transforms=[
613         # Use IgnoreSymbolTransforms like the following to completely
614         # ignore symbols matching a regular expression when parsing
615         # the CVS repository, for example to avoid warnings about
616         # branches with two names and to choose the preferred name.
617         # It is *not* recommended to use this instead of
618         # ExcludeRegexpStrategyRule; though more efficient,
619         # IgnoreSymbolTransforms are less flexible and don't exclude
620         # branches correctly.  The argument is a Python-style regular
621         # expression that has to match the *whole* CVS symbol name:
622         #IgnoreSymbolTransform(r'nightly-build-tag-.*')
624         # RegexpSymbolTransforms transform symbols textually using a
625         # regular expression.  The first argument is a Python regular
626         # expression pattern and the second is a replacement pattern.
627         # The pattern is matched against each symbol name.  If it
628         # matches the whole symbol name, then the symbol name is
629         # replaced with the corresponding replacement text.  The
630         # replacement can include substitution patterns (e.g., r'\1'
631         # or r'\g<name>').  Typically you will want to use raw strings
632         # (strings with a preceding 'r', like shown in the examples)
633         # for the regexp and its replacement to avoid backslash
634         # substitution within those strings.
635         #RegexpSymbolTransform(r'release-(\d+)_(\d+)',
636         #                      r'release-\1.\2'),
637         #RegexpSymbolTransform(r'release-(\d+)_(\d+)_(\d+)',
638         #                      r'release-\1.\2.\3'),
640         # Simple 1:1 character replacements can also be done.  The
641         # following transform, which converts backslashes into forward
642         # slashes, should usually be included:
643         ReplaceSubstringsSymbolTransform('\\','/'),
645         # Eliminate leading, trailing, and repeated slashes.  This
646         # transform should always be included:
647         NormalizePathsSymbolTransform(),
648         ],
649     symbol_strategy_rules=[
650         # Additional, project-specific symbol strategy rules can
651         # be added here.
652         ] + global_symbol_strategy_rules,
654     # Exclude paths from the conversion. Should be relative to
655     # repository path and use forward slashes:
656     #exclude_paths=['file-to-exclude.txt,v', 'dir/to/exclude'],
657     )
659 # Add a second project, to be stored to projA/trunk, projA/branches,
660 # and projA/tags:
661 #run_options.add_project(
662 #    r'my/cvsrepo/projA',
663 #    trunk_path='projA/trunk',
664 #    branches_path='projA/branches',
665 #    tags_path='projA/tags',
666 #    initial_directories=[
667 #        ],
668 #    symbol_transforms=[
669 #        #RegexpSymbolTransform(r'release-(\d+)_(\d+)',
670 #        #                      r'release-\1.\2'),
671 #        #RegexpSymbolTransform(r'release-(\d+)_(\d+)_(\d+)',
672 #        #                      r'release-\1.\2.\3'),
673 #        ReplaceSubstringsSymbolTransform('\\','/'),
674 #        NormalizePathsSymbolTransform(),
675 #        ],
676 #    symbol_strategy_rules=[
677 #        # Additional, project-specific symbol strategy rules can
678 #        # be added here.
679 #        ] + global_symbol_strategy_rules,
680 #    )
682 # Change this option to True to turn on profiling of cvs2svn (for
683 # debugging purposes):
684 run_options.profiling = False
687 # Should CVSItem -> Changeset database files be memory mapped?  In
688 # some tests, using memory mapping speeded up the overall conversion
689 # by about 5%.  But this option can cause the conversion to fail with
690 # an out of memory error if the conversion computer runs out of
691 # virtual address space (e.g., when running a very large conversion on
692 # a 32-bit operating system).  Therefore it is disabled by default.
693 # Uncomment the following line to allow these database files to be
694 # memory mapped.
695 #changeset_database.use_mmap_for_cvs_item_to_changeset_table = True