Add a test that unlabeled branches can be excluded.
[cvs2svn.git] / cvs2git-example.options
blob854ac17d596dc1feb04e7adde1927d8307ea4b97
1 # (Be in -*- mode: python; coding: utf-8 -*- mode.)
3 # ====================================================================
4 # Copyright (c) 2006-2010 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 to convert to git rather than to Subversion.  See
23 # www/cvs2git.html and www/cvs2svn.html for general information, and
24 # see the comments in this file for information about what options are
25 # available and how they can be set.
27 # The program that is run to convert from CVS to git is called
28 # cvs2git.  Run it with the --options option, passing it this file
29 # like this:
31 #     cvs2git --options=cvs2git-example.options
33 # The output of cvs2git is a blob file and a dump file that can be
34 # loaded into git using the "git fast-import" command.  Please read
35 # www/cvs2git.html for more information.
37 # Many options do not have defaults, so it is easier to copy this file
38 # and modify what you need rather than creating a new options file
39 # from scratch.  This file is in Python syntax, but you don't need to
40 # know Python to modify it.  But if you *do* know Python, then you
41 # will be happy to know that you can use arbitary Python constructs to
42 # do fancy configuration tricks.
44 # But please be aware of the following:
46 # * In many places, leading whitespace is significant in Python (it is
47 #   used instead of curly braces to group statements together).
48 #   Therefore, if you don't know what you are doing, it is best to
49 #   leave the whitespace as it is.
51 # * In normal strings, Python treats a backslash ("\") as an escape
52 #   character.  Therefore, if you want to specify a string that
53 #   contains a backslash, you need either to escape the backslash with
54 #   another backslash ("\\"), or use a "raw string", as in one if the
55 #   following equivalent examples:
57 #       cvs_executable = 'c:\\windows\\system32\\cvs.exe'
58 #       cvs_executable = r'c:\windows\system32\cvs.exe'
60 #   See http://docs.python.org/tutorial/introduction.html#strings for
61 #   more information.
63 # Two identifiers will have been defined before this file is executed,
64 # and can be used freely within this file:
66 #     ctx -- a Ctx object (see cvs2svn_lib/context.py), which holds
67 #         many configuration options
69 #     run_options -- an instance of the GitRunOptions class (see
70 #         cvs2svn_lib/git_run_options.py), which holds some variables
71 #         governing how cvs2git is run
74 # Import some modules that are used in setting the options:
75 import os
77 from cvs2svn_lib import config
78 from cvs2svn_lib import changeset_database
79 from cvs2svn_lib.common import CVSTextDecoder
80 from cvs2svn_lib.log import logger
81 from cvs2svn_lib.project import Project
82 from cvs2svn_lib.git_revision_collector import GitRevisionCollector
83 from cvs2svn_lib.external_blob_generator import ExternalBlobGenerator
84 from cvs2svn_lib.git_output_option import GitRevisionMarkWriter
85 from cvs2svn_lib.git_output_option import GitOutputOption
86 from cvs2svn_lib.dvcs_common import KeywordHandlingPropertySetter
87 from cvs2svn_lib.revision_manager import NullRevisionCollector
88 from cvs2svn_lib.rcs_revision_manager import RCSRevisionReader
89 from cvs2svn_lib.cvs_revision_manager import CVSRevisionReader
90 from cvs2svn_lib.symbol_strategy import AllBranchRule
91 from cvs2svn_lib.symbol_strategy import AllTagRule
92 from cvs2svn_lib.symbol_strategy import BranchIfCommitsRule
93 from cvs2svn_lib.symbol_strategy import ExcludeRegexpStrategyRule
94 from cvs2svn_lib.symbol_strategy import ForceBranchRegexpStrategyRule
95 from cvs2svn_lib.symbol_strategy import ForceTagRegexpStrategyRule
96 from cvs2svn_lib.symbol_strategy import ExcludeTrivialImportBranchRule
97 from cvs2svn_lib.symbol_strategy import ExcludeVendorBranchRule
98 from cvs2svn_lib.symbol_strategy import HeuristicStrategyRule
99 from cvs2svn_lib.symbol_strategy import UnambiguousUsageRule
100 from cvs2svn_lib.symbol_strategy import HeuristicPreferredParentRule
101 from cvs2svn_lib.symbol_strategy import SymbolHintsFileRule
102 from cvs2svn_lib.symbol_transform import ReplaceSubstringsSymbolTransform
103 from cvs2svn_lib.symbol_transform import RegexpSymbolTransform
104 from cvs2svn_lib.symbol_transform import IgnoreSymbolTransform
105 from cvs2svn_lib.symbol_transform import NormalizePathsSymbolTransform
106 from cvs2svn_lib.property_setters import AutoPropsPropertySetter
107 from cvs2svn_lib.property_setters import CVSBinaryFileDefaultMimeTypeSetter
108 from cvs2svn_lib.property_setters import CVSBinaryFileEOLStyleSetter
109 from cvs2svn_lib.property_setters import DefaultEOLStyleSetter
110 from cvs2svn_lib.property_setters import EOLStyleFromMimeTypeSetter
111 from cvs2svn_lib.property_setters import ExecutablePropertySetter
112 from cvs2svn_lib.property_setters import KeywordsPropertySetter
113 from cvs2svn_lib.property_setters import MimeMapper
114 from cvs2svn_lib.property_setters import SVNBinaryFileKeywordsPropertySetter
116 # To choose the level of logging output, uncomment one of the
117 # following lines:
118 #logger.log_level = logger.WARN
119 #logger.log_level = logger.QUIET
120 logger.log_level = logger.NORMAL
121 #logger.log_level = logger.VERBOSE
122 #logger.log_level = logger.DEBUG
125 # The directory to use for temporary files:
126 ctx.tmpdir = r'cvs2svn-tmp'
128 # During FilterSymbolsPass, cvs2git records the contents of file
129 # revisions into a "blob" file in git-fast-import format.  The
130 # ctx.revision_collector option configures that process.  Choose one of the two ersions and customize its options.
132 # This first alternative is much slower but is better tested and has a
133 # chance of working with CVSNT repositories.  It invokes CVS or RCS to
134 # reconstuct the contents of CVS file revisions:
135 ctx.revision_collector = GitRevisionCollector(
136     # The file in which to write the git-fast-import stream that
137     # contains the file revision contents:
138     'cvs2svn-tmp/git-blob.dat',
140     # The following option specifies how the revision contents of the
141     # RCS files should be read.
142     #
143     # RCSRevisionReader uses RCS's "co" program to extract the
144     # revision contents of the RCS files during CollectRevsPass.  The
145     # constructor argument specifies how to invoke the "co"
146     # executable.
147     #
148     # CVSRevisionReader uses the "cvs" program to extract the revision
149     # contents out of the RCS files during OutputPass.  This option is
150     # considerably slower than RCSRevisionReader because "cvs" is
151     # considerably slower than "co".  However, it works in some
152     # situations where RCSRevisionReader fails; see the HTML
153     # documentation of the "--use-cvs" option for details.  The
154     # constructor argument specifies how to invoke the "co"
155     # executable.
156     #
157     # Uncomment one of the two following lines:
158     #RCSRevisionReader(co_executable=r'co'),
159     CVSRevisionReader(cvs_executable=r'cvs'),
160     )
161 # This second alternative is vastly faster than the version above.  It
162 # uses an external Python program to reconstruct the contents of CVS
163 # file revisions:
164 #ctx.revision_collector = ExternalBlobGenerator('cvs2svn-tmp/git-blob.dat')
166 # cvs2git doesn't need a revision reader because OutputPass only
167 # refers to blobs that were output during CollectRevsPass, so leave
168 # this option set to None.
169 ctx.revision_reader = None
171 # Change the following line to True if the conversion should only
172 # include the trunk of the repository (i.e., all branches and tags
173 # should be omitted from the conversion):
174 ctx.trunk_only = False
176 # How to convert CVS author names, log messages, and filenames to
177 # Unicode.  The first argument to CVSTextDecoder is a list of encoders
178 # that are tried in order in 'strict' mode until one of them succeeds.
179 # If none of those succeeds, then fallback_encoder (if it is
180 # specified) is used in lossy 'replace' mode.  Setting a fallback
181 # encoder ensures that the encoder always succeeds, but it can cause
182 # information loss.
183 ctx.cvs_author_decoder = CVSTextDecoder(
184     [
185         #'utf8',
186         #'latin1',
187         'ascii',
188         ],
189     #fallback_encoding='ascii'
190     )
191 ctx.cvs_log_decoder = CVSTextDecoder(
192     [
193         #'utf8',
194         #'latin1',
195         'ascii',
196         ],
197     #fallback_encoding='ascii'
198     )
199 # You might want to be especially strict when converting filenames to
200 # Unicode (e.g., maybe not specify a fallback_encoding).
201 ctx.cvs_filename_decoder = CVSTextDecoder(
202     [
203         #'utf8',
204         #'latin1',
205         'ascii',
206         ],
207     #fallback_encoding='ascii'
208     )
210 # Template for the commit message to be used for initial project
211 # commits.
212 ctx.initial_project_commit_message = (
213     'Standard project directories initialized by cvs2svn.'
214     )
216 # Template for the commit message to be used for post commits, in
217 # which modifications to a vendor branch are copied back to trunk.
218 # This message can use '%(revnum)d' to include the SVN revision number
219 # of the revision that included the change to the vendor branch
220 # (admittedly rather pointless in a cvs2git conversion).
221 ctx.post_commit_message = (
222     'This commit was generated by cvs2svn to track changes on a CVS '
223     'vendor branch.'
224     )
226 # Template for the commit message to be used for commits in which
227 # symbols are created.  This message can use '%(symbol_type)s' to
228 # include the type of the symbol ('branch' or 'tag') or
229 # '%(symbol_name)s' to include the name of the symbol.
230 ctx.symbol_commit_message = (
231     "This commit was manufactured by cvs2svn to create %(symbol_type)s "
232     "'%(symbol_name)s'."
233     )
235 # Template for the commit message to be used for commits in which
236 # tags are pseudo-merged back to their source branch.  This message can
237 # use '%(symbol_name)s' to include the name of the symbol.
238 # (Not used by default unless you enable tie_tag_fixup_branches on
239 # GitOutputOption.)
240 ctx.tie_tag_ancestry_message = (
241     "This commit was manufactured by cvs2svn to tie ancestry for "
242     "tag '%(symbol_name)s' back to the source branch."
243     )
245 # Some CVS clients for MacOS store resource fork data into CVS along
246 # with the file contents itself by wrapping it all up in a container
247 # format called "AppleSingle".  Subversion currently does not support
248 # MacOS resource forks.  Nevertheless, sometimes the resource fork
249 # information is not necessary and can be discarded.  Set the
250 # following option to True if you would like cvs2svn to identify files
251 # whose contents are encoded in AppleSingle format, and discard all
252 # but the data fork for such files before committing them to
253 # Subversion.  (Please note that AppleSingle contents are identified
254 # by the AppleSingle magic number as the first four bytes of the file.
255 # This check is not failproof, so only set this option if you think
256 # you need it.)
257 ctx.decode_apple_single = False
259 # This option can be set to the name of a filename to which are stored
260 # statistics and conversion decisions about the CVS symbols.
261 ctx.symbol_info_filename = None
262 #ctx.symbol_info_filename = 'symbol-info.txt'
264 # cvs2svn uses "symbol strategy rules" to help decide how to handle
265 # CVS symbols.  The rules in a project's symbol_strategy_rules are
266 # applied in order, and each rule is allowed to modify the symbol.
267 # The result (after each of the rules has been applied) is used for
268 # the conversion.
270 # 1. A CVS symbol might be used as a tag in one file and as a branch
271 #    in another file.  cvs2svn has to decide whether to convert such a
272 #    symbol as a tag or as a branch.  cvs2svn uses a series of
273 #    heuristic rules to decide how to convert a symbol.  The user can
274 #    override the default rules for specific symbols or symbols
275 #    matching regular expressions.
277 # 2. cvs2svn is also capable of excluding symbols from the conversion
278 #    (provided no other symbols depend on them.
280 # 3. CVS does not record unambiguously the line of development from
281 #    which a symbol sprouted.  cvs2svn uses a heuristic to choose a
282 #    symbol's "preferred parents".
284 # The standard branch/tag/exclude StrategyRules do not change a symbol
285 # that has already been processed by an earlier rule, so in effect the
286 # first matching rule is the one that is used.
288 global_symbol_strategy_rules = [
289     # It is possible to specify manually exactly how symbols should be
290     # converted and what line of development should be used as the
291     # preferred parent.  To do so, create a file containing the symbol
292     # hints and enable the following option.
293     #
294     # The format of the hints file is described in the documentation
295     # for the --symbol-hints command-line option.  The file output by
296     # the --write-symbol-info (i.e., ctx.symbol_info_filename) option
297     # is in the same format.  The simplest way to use this option is
298     # to run the conversion through CollateSymbolsPass with
299     # --write-symbol-info option, copy the symbol info and edit it to
300     # create a hints file, then re-start the conversion at
301     # CollateSymbolsPass with this option enabled.
302     #SymbolHintsFileRule('symbol-hints.txt'),
304     # To force all symbols matching a regular expression to be
305     # converted as branches, add rules like the following:
306     #ForceBranchRegexpStrategyRule(r'branch.*'),
308     # To force all symbols matching a regular expression to be
309     # converted as tags, add rules like the following:
310     #ForceTagRegexpStrategyRule(r'tag.*'),
312     # To force all symbols matching a regular expression to be
313     # excluded from the conversion, add rules like the following:
314     #ExcludeRegexpStrategyRule(r'unknown-.*'),
316     # Sometimes people use "cvs import" to get their own source code
317     # into CVS.  This practice creates a vendor branch 1.1.1 and
318     # imports the code onto the vendor branch as 1.1.1.1, then copies
319     # the same content to the trunk as version 1.1.  Normally, such
320     # vendor branches are useless and they complicate the SVN history
321     # unnecessarily.  The following rule excludes any branches that
322     # only existed as a vendor branch with a single import (leaving
323     # only the 1.1 revision).  If you want to retain such branches,
324     # comment out the following line.  (Please note that this rule
325     # does not exclude vendor *tags*, as they are not so easy to
326     # identify.)
327     ExcludeTrivialImportBranchRule(),
329     # To exclude all vendor branches (branches that had "cvs import"s
330     # on them but no other kinds of commits), uncomment the following
331     # line:
332     #ExcludeVendorBranchRule(),
334     # Usually you want this rule, to convert unambiguous symbols
335     # (symbols that were only ever used as tags or only ever used as
336     # branches in CVS) the same way they were used in CVS:
337     UnambiguousUsageRule(),
339     # If there was ever a commit on a symbol, then it cannot be
340     # converted as a tag.  This rule causes all such symbols to be
341     # converted as branches.  If you would like to resolve such
342     # ambiguities manually, comment out the following line:
343     BranchIfCommitsRule(),
345     # Last in the list can be a catch-all rule that is used for
346     # symbols that were not matched by any of the more specific rules
347     # above.  (Assuming that BranchIfCommitsRule() was included above,
348     # then the symbols that are still indeterminate at this point can
349     # sensibly be converted as branches or tags.)  Include at most one
350     # of these lines.  If none of these catch-all rules are included,
351     # then the presence of any ambiguous symbols (that haven't been
352     # disambiguated above) is an error:
354     # Convert ambiguous symbols based on whether they were used more
355     # often as branches or as tags:
356     HeuristicStrategyRule(),
357     # Convert all ambiguous symbols as branches:
358     #AllBranchRule(),
359     # Convert all ambiguous symbols as tags:
360     #AllTagRule(),
362     # The last rule is here to choose the preferred parent of branches
363     # and tags, that is, the line of development from which the symbol
364     # sprouts.
365     HeuristicPreferredParentRule(),
366     ]
368 # Specify a username to be used for commits for which CVS doesn't
369 # record the original author (for example, the creation of a branch).
370 # This should be a simple (unix-style) username, but it can be
371 # translated into a git-style name by the author_transforms map.
372 ctx.username = 'cvs2svn'
374 # ctx.file_property_setters and ctx.revision_property_setters contain
375 # rules used to set the svn properties on files in the converted
376 # archive.  For each file, the rules are tried one by one.  Any rule
377 # can add or suppress one or more svn properties.  Typically the rules
378 # will not overwrite properties set by a previous rule (though they
379 # are free to do so).  ctx.file_property_setters should be used for
380 # properties that remain the same for the life of the file; these
381 # should implement FilePropertySetter.  ctx.revision_property_setters
382 # should be used for properties that are allowed to vary from revision
383 # to revision; these should implement RevisionPropertySetter.
385 # Obviously, SVN properties per se are not interesting for a cvs2git
386 # conversion, but some of these properties have side-effects that do
387 # affect the git output.  FIXME: Document this in more detail.
388 ctx.file_property_setters.extend([
389     # To read auto-props rules from a file, uncomment the following line
390     # and specify a filename.  The boolean argument specifies whether
391     # case should be ignored when matching filenames to the filename
392     # patterns found in the auto-props file:
393     #AutoPropsPropertySetter(
394     #    r'/home/username/.subversion/config',
395     #    ignore_case=True,
396     #    ),
398     # To read mime types from a file and use them to set svn:mime-type
399     # based on the filename extensions, uncomment the following line
400     # and specify a filename (see
401     # http://en.wikipedia.org/wiki/Mime.types for information about
402     # mime.types files):
403     #MimeMapper(r'/etc/mime.types', ignore_case=False),
405     # Omit the svn:eol-style property from any files that are listed
406     # as binary (i.e., mode '-kb') in CVS:
407     CVSBinaryFileEOLStyleSetter(),
409     # If the file is binary and its svn:mime-type property is not yet
410     # set, set svn:mime-type to 'application/octet-stream'.
411     CVSBinaryFileDefaultMimeTypeSetter(),
413     # To try to determine the eol-style from the mime type, uncomment
414     # the following line:
415     #EOLStyleFromMimeTypeSetter(),
417     # Choose one of the following lines to set the default
418     # svn:eol-style if none of the above rules applied.  The argument
419     # is the svn:eol-style that should be applied, or None if no
420     # svn:eol-style should be set (i.e., the file should be treated as
421     # binary).
422     #
423     # The default is to treat all files as binary unless one of the
424     # previous rules has determined otherwise, because this is the
425     # safest approach.  However, if you have been diligent about
426     # marking binary files with -kb in CVS and/or you have used the
427     # above rules to definitely mark binary files as binary, then you
428     # might prefer to use 'native' as the default, as it is usually
429     # the most convenient setting for text files.  Other possible
430     # options: 'CRLF', 'CR', 'LF'.
431     DefaultEOLStyleSetter(None),
432     #DefaultEOLStyleSetter('native'),
434     # Prevent svn:keywords from being set on files that have
435     # svn:eol-style unset.
436     SVNBinaryFileKeywordsPropertySetter(),
438     # If svn:keywords has not been set yet, set it based on the file's
439     # CVS mode:
440     KeywordsPropertySetter(config.SVN_KEYWORDS_VALUE),
442     # Set the svn:executable flag on any files that are marked in CVS as
443     # being executable:
444     ExecutablePropertySetter(),
446     # The following causes keywords to be collapsed in all text to be
447     # committed:
448     KeywordHandlingPropertySetter('collapsed'),
450     ])
451 ctx.revision_property_setters.extend([
452     ])
454 # To skip the cleanup of temporary files, uncomment the following
455 # option:
456 #ctx.skip_cleanup = True
459 # In CVS, it is perfectly possible to make a single commit that
460 # affects more than one project or more than one branch of a single
461 # project.  Subversion also allows such commits.  Therefore, by
462 # default, when cvs2svn sees what looks like a cross-project or
463 # cross-branch CVS commit, it converts it into a
464 # cross-project/cross-branch Subversion commit.
466 # However, other tools and SCMs have trouble representing
467 # cross-project or cross-branch commits.  (For example, Trac's Revtree
468 # plugin, http://www.trac-hacks.org/wiki/RevtreePlugin is confused by
469 # such commits.)  Therefore, we provide the following two options to
470 # allow cross-project/cross-branch commits to be suppressed.
472 # cvs2git only supports single-project conversions (multiple-project
473 # conversions wouldn't really make sense for git anyway).  So this
474 # option must be set to False:
475 ctx.cross_project_commits = False
477 # git itself doesn't allow commits that affect more than one branch,
478 # so this option must be set to False:
479 ctx.cross_branch_commits = False
481 # cvs2git does not yet handle translating .cvsignore files into
482 # .gitignore files, so by default, the .cvsignore files are included
483 # in the conversion output.  If you would like to omit the .cvsignore
484 # files from the output, set this option to False:
485 ctx.keep_cvsignore = True
487 # By default, it is a fatal error for a CVS ",v" file to appear both
488 # inside and outside of an "Attic" subdirectory (this should never
489 # happen, but frequently occurs due to botched repository
490 # administration).  If you would like to retain both versions of such
491 # files, change the following option to True, and the attic version of
492 # the file will be written to a subdirectory called "Attic" in the
493 # output repository:
494 ctx.retain_conflicting_attic_files = False
496 # CVS uses unix login names as author names whereas git requires
497 # author names to be of the form "foo <bar>".  The default is to set
498 # the git author to "cvsauthor <cvsauthor>".  author_transforms can be
499 # used to map cvsauthor names (e.g., "jrandom") to a true name and
500 # email address (e.g., "J. Random <jrandom@example.com>" for the
501 # example shown).  All strings should be either Unicode strings (i.e.,
502 # with "u" as a prefix) or 8-bit strings in the utf-8 encoding.  The
503 # values can either be strings in the form "name <email>" or tuples
504 # (name, email).  Please substitute your own project's usernames here
505 # to use with the author_transforms option of GitOutputOption below.
506 author_transforms={
507     'jrandom' : ('J. Random', 'jrandom@example.com'),
508     'mhagger' : 'Michael Haggerty <mhagger@alum.mit.edu>',
509     'brane' : (u'Branko Čibej', 'brane@xbc.nu'),
510     'ringstrom' : 'Tobias Ringström <tobias@ringstrom.mine.nu>',
511     'dionisos' : (u'Erik Hülsmann', 'e.huelsmann@gmx.net'),
513     # This one will be used for commits for which CVS doesn't record
514     # the original author, as explained above.
515     'cvs2svn' : 'cvs2svn <admin@example.com>',
516     }
518 # This is the main option that causes cvs2svn to output to a
519 # "fastimport"-format dumpfile rather than to Subversion:
520 ctx.output_option = GitOutputOption(
521     # The file in which to write the git-fast-import stream that
522     # contains the changesets and branch/tag information:
523     os.path.join(ctx.tmpdir, 'git-dump.dat'),
525     # The blobs will be written via the revision recorder, so in
526     # OutputPass we only have to emit references to the blob marks:
527     GitRevisionMarkWriter(),
529     # Optional map from CVS author names to git author names:
530     author_transforms=author_transforms,
531     )
533 # Change this option to True to turn on profiling of cvs2svn (for
534 # debugging purposes):
535 run_options.profiling = False
538 # Should CVSItem -> Changeset database files be memory mapped?  In
539 # some tests, using memory mapping speeded up the overall conversion
540 # by about 5%.  But this option can cause the conversion to fail with
541 # an out of memory error if the conversion computer runs out of
542 # virtual address space (e.g., when running a very large conversion on
543 # a 32-bit operating system).  Therefore it is disabled by default.
544 # Uncomment the following line to allow these database files to be
545 # memory mapped.
546 #changeset_database.use_mmap_for_cvs_item_to_changeset_table = True
548 # Now set the project to be converted to git.  cvs2git only supports
549 # single-project conversions, so this method must only be called
550 # once:
551 run_options.set_project(
552     # The filesystem path to the part of the CVS repository (*not* a
553     # CVS working copy) that should be converted.  This may be a
554     # subdirectory (i.e., a module) within a larger CVS repository.
555     r'test-data/main-cvsrepos',
557     # A list of symbol transformations that can be used to rename
558     # symbols in this project.
559     symbol_transforms=[
560         # Use IgnoreSymbolTransforms like the following to completely
561         # ignore symbols matching a regular expression when parsing
562         # the CVS repository, for example to avoid warnings about
563         # branches with two names and to choose the preferred name.
564         # It is *not* recommended to use this instead of
565         # ExcludeRegexpStrategyRule; though more efficient,
566         # IgnoreSymbolTransforms are less flexible and don't exclude
567         # branches correctly.  The argument is a Python-style regular
568         # expression that has to match the *whole* CVS symbol name:
569         #IgnoreSymbolTransform(r'nightly-build-tag-.*')
571         # RegexpSymbolTransforms transform symbols textually using a
572         # regular expression.  The first argument is a Python regular
573         # expression pattern and the second is a replacement pattern.
574         # The pattern is matched against each symbol name.  If it
575         # matches the whole symbol name, then the symbol name is
576         # replaced with the corresponding replacement text.  The
577         # replacement can include substitution patterns (e.g., r'\1'
578         # or r'\g<name>').  Typically you will want to use raw strings
579         # (strings with a preceding 'r', like shown in the examples)
580         # for the regexp and its replacement to avoid backslash
581         # substitution within those strings.
582         #RegexpSymbolTransform(r'release-(\d+)_(\d+)',
583         #                      r'release-\1.\2'),
584         #RegexpSymbolTransform(r'release-(\d+)_(\d+)_(\d+)',
585         #                      r'release-\1.\2.\3'),
587         # Simple 1:1 character replacements can also be done.  The
588         # following transform, which converts backslashes into forward
589         # slashes, should usually be included:
590         ReplaceSubstringsSymbolTransform('\\','/'),
592         # This last rule eliminates leading, trailing, and repeated
593         # slashes within the output symbol names:
594         NormalizePathsSymbolTransform(),
595         ],
597     # See the definition of global_symbol_strategy_rules above for a
598     # description of this option:
599     symbol_strategy_rules=global_symbol_strategy_rules,
600     )