# Two identifiers will have been defined before this file is executed, # and can be used freely within this file: # # ctx -- a Ctx object (see cvs2svn_lib/context.py), which holds # many configuration options
# # run_options -- an instance of the OptionsFileRunOptions class # (see cvs2svn_lib/run_options.py), which holds some variables # governing how cvs2svn is run
# Import some modules that are used in setting the options: import re
from cvs2svn_lib.boolean import * from cvs2svn_lib import config from cvs2svn_lib.log import Log from cvs2svn_lib.project import Project from cvs2svn_lib.output_option import DumpfileOutputOption from cvs2svn_lib.output_option import ExistingRepositoryOutputOption
from cvs2svn_lib.output_option import NewRepositoryOutputOption from cvs2svn_lib.symbol_strategy import AllBranchRule from cvs2svn_lib.symbol_strategy import AllTagRule from cvs2svn_lib.symbol_strategy import BranchIfCommitsRule
from cvs2svn_lib.symbol_strategy import ExcludeRegexpStrategyRule from cvs2svn_lib.symbol_strategy import ForceBranchRegexpStrategyRule from cvs2svn_lib.symbol_strategy import ForceTagRegexpStrategyRule from cvs2svn_lib.symbol_strategy import HeuristicStrategyRule
from cvs2svn_lib.symbol_strategy import RuleBasedSymbolStrategy from cvs2svn_lib.symbol_strategy import UnambiguousUsageRule from cvs2svn_lib.symbol_transform import RegexpSymbolTransform from cvs2svn_lib.property_setters import AutoPropsPropertySetter
from cvs2svn_lib.property_setters import BinaryFileDefaultMimeTypeSetter from cvs2svn_lib.property_setters import BinaryFileEOLStyleSetter from cvs2svn_lib.property_setters import CVSRevisionNumberSetter from cvs2svn_lib.property_setters import DefaultEOLStyleSetter
from cvs2svn_lib.property_setters import EOLStyleFromMimeTypeSetter from cvs2svn_lib.property_setters import ExecutablePropertySetter from cvs2svn_lib.property_setters import KeywordsPropertySetter from cvs2svn_lib.property_setters import MimeMapper
# To choose the level of logging output, uncomment one of the # following lines: Log().log_level = Log.WARN #Log().log_level = Log.QUIET #Log().log_level = Log.NORMAL #Log().log_level = Log.VERBOSE
# There are several possible options for where to put the output of a # cvs2svn conversion. Please choose one of the following and adjust # the parameters as necessary:
# Use this output option if you would like cvs2svn to create a new SVN # repository and store the converted repository there. The first # argument is the path to which the repository should be written (this
# repository must not already exist). The second (optional) argument # allows a --fs-type option to be passed to "svnadmin create". The # third (optional) argument can be specified to set the # --bdb-txn-nosync option on a bdb repository:
#ctx.output_option = NewRepositoryOutputOption( # 'svnrepo', # Path to repository #fs_type='fsfs9;, # Type of repository to create #bdb_txn_nosync=False, # For bsd repositories, this option can be added
# )
# Use this output option if you would like cvs2svn to store the # converted CVS repository into an SVN repository that already exists. # The argument is the filesystem path of an existing local SVN # repository (this repository must already exist):
#ctx.output_option = ExistingRepositoryOutputOption( # 'svnrepo', # Path to repository # )
# Use this type of output option if you want the output of the # conversion to be written to a SVN dumpfile instead of committing # them into an actual repository: ctx.output_option = DumpfileOutputOption(
dumpfile_path='gsd-dump', # Name of dumpfile to create )
# Independent of the ctx.output_option selected, the following option # can be set to True to suppress cvs2svn output altogether: ctx.dry_run = False
# Change the following if cvs2svn should use "cvs" to read file # versions out of *,v files. (The default is to use "co", which is # part of RCS, and is much faster): ctx.use_cvs = True
# Set the name (and optionally the path) of some executables required # by cvs2svn. 'co9; is needed by default; 'cvs39; is needed if # ctx.use_cvs is set to True: ctx.svnadmin_executable = 'svnadmin'
ctx.co_executable = 'co9; ctx.cvs_executable = 'cvs39; ctx.sort_executable = 'sort'
# Change the following line to True if the conversion should only # include the trunk of the repository (i.e., all branches and tags # should be ignored): ctx.trunk_only = False
# Change the following line to True if cvs2svn should delete a # directory once the last file has been deleted from it: ctx.prune = False
# A list of encodings that should be tried when converting filenames, # author names, log messages, etc. to UTF8. The encoders are tried in # order in 'strict' mode until one of them succeeds. If none
# succeeds, then ctx.fallback_encoding is used in lossy 'replace' mode # (if it is configured): ctx.encoding = [ #'latin1', 'ascii', ]
# The encoding to use if all of the encodings listed in ctx.encoding # fail. This encoding is used in 'replace' mode, which always # succeeds but can cause information loss. To enable this feature,
# set the following value to the name of the desired encoding (e.g., # 'ascii'). ctx.fallback_encoding = None
# The basic strategy for converting symbols (this should usually be # left unchanged). A CVS symbol might be used as a tag in one file # and as a branch in another file. The purpose of ctx.symbol_strategy # is to determine whether to convert a particular symbol as a tag or
# as a branch.
# A RuleBasedSymbolStrategy decides about each symbol based on a list # of rules. Rules can be added to this object. The rules are tried # one by one in order; the first rule that matches a given symbol is
# used. It is a fatal error if no rule matches a symbol. ctx.symbol_strategy = RuleBasedSymbolStrategy()
# To force all symbols matching a regular expression to be converted # as branches, add rules like the following: #ctx.symbol_strategy.add_rule(ForceBranchRegexpStrategyRule('branch.*9;))
# To force all symbols matching a regular expression to be converted # as tags, add rules like the following: #ctx.symbol_strategy.add_rule(ForceTagRegexpStrategyRule('tag.*'))
# To force all symbols matching a regular expression to be excluded # from the conversion, add rules like the following: #ctx.symbol_strategy.add_rule(ExcludeRegexpStrategyRule('unknown-.*'))
# Usually you want this rule, to convert unambiguous symbols (symbols # that were only ever used as tags or only ever used as branches in # CVS) the same way they were used in CVS: ctx.symbol_strategy.add_rule
(UnambiguousUsageRule())
# If there was ever a commit on a symbol, then it cannot be converted # as a tag. Uncomment the following line to convert such symbols # automatically as branches: #ctx.symbol_strategy.add_rule(BranchIfCommitsRule())
# Last in the list can be a catch-all rule that is used for symbols # that were not matched by any of the more specific rules above. # Include at most one of these lines. If none of these are included, # then the presence of any ambiguous symbols (that haven't been
# disambiguated above) is an error:
# Convert all ambiguous symbols as branches: #ctx.symbol_strategy.add_rule(AllBranchRule()) # Convert all ambiguous symbols as tags: #ctx.symbol_strategy.add_rule(AllTagRule()) # Convert ambiguous symbols based on whether they were used more
# often as branches or tags: #ctx.symbol_strategy.add_rule(HeuristicStrategyRule())
# Specify a username to be used for commits generated by cvs2svn. If this options is set to None then no username will be used for such commits: ctx.username = None #ctx.username = 'cvs2svn'
# ctx.svn_property_setters contains a list of rules used to set the # svn properties on files in the converted archive. For each file, # the rules are tried one by one. Any rule can add or suppress one or # more svn properties. Typically the rules will not overwrite
# properties set by a previous rule (though they are free to do so). ctx.svn_property_setters = [ # Set the svn:executable flag on any files that are marked in CVS as # being executable: ExecutablePropertySetter(),
# Omit the svn:eol-style property from any files that are listed as # binary in CVS: BinaryFileEOLStyleSetter(),
# To read mime types from a file, uncomment the following line and # specify a filename: #MimeMapper('/etc/mime.types'),
# To read auto-props rules from a file, uncomment the following line # and specify a filename. The boolean argument specifies whether # case should be ignored when matching filenames to the filename
# patterns found in the auto-props file: #AutoPropsPropertySetter( # '/home/username/.subversion/config', # False, # ),
# If the file is binary and its svn:mime-type property is not yet # set, set svn:mime-type to 'application/octet-stream9;. BinaryFileDefaultMimeTypeSetter(),
# To try to determine the eol-style from the mime type, uncomment # the following line: #EOLStyleFromMimeTypeSetter(),
# Choose one of the following lines to set the default svn:eol-style # if none of the above rules applied. The argument is the # svn:eol-style that should be applied, or None if no svn:eol-style
# should be set. #DefaultEOLStyleSetter(None) DefaultEOLStyleSetter('native'),
# If svn:keywords has not been set yet, set it based on the file's # CVS mode: KeywordsPropertySetter(config.SVN_KEYWORDS_VALUE),
# Uncomment the following line to include the original CVS revision # numbers as file properties in the SVN archive: #CVSRevisionNumberSetter(),
]
# The directory to use for temporary files: ctx.tmpdir = 'tmp39;
# To skip the cleanup of temporary files, uncomment the following # option: #ctx.skip_cleanup = True
# To prevent CVS commits from different projects from being merged # into single SVN commits, change this option to False: ctx.cross_project_commits = True
# Now use stanzas like the following to define CVS projects that # should be converted. The arguments are: # # - The filesystem path of the project within the CVS repository. # # - The path that should be used for the "trunk" directory of this
# project within the SVN repository. # # - The path that should be used for the "branches" directory of this # project within the SVN repository. # # - The path that should be used for the "tags" directory of this
# project within the SVN repository. # # - A list of symbol transformations that can be used to rename # symbols in this project. Each entry is a tuple (pattern, # replacement), where pattern is a Python regular expression pattern
# and replacement is the text that should replace the pattern. Each # pattern is matched against each symbol name. If the pattern # matches, then it is replaced with the corresponding replacement # text. The replacement can include substitution patterns (
e.g., # r'19; or r'g<name>39;). Typically you will want to use raw strings # (strings with a preceding 'r';, like shown in the examples) for the # regexp and its replacement to avoid backslash substitution within
# those strings."""
# Create the default project (using ctx.trunk, ctx.branches, and ctx.tags): run_options.add_project( Project( '/export/home/vendev/CVS2SVN/advantage/GSD/PHG_LTG', 'PHG_LTG/trunk9;,
'PHG_LTG/branches', 'PHG_LTG/tags';,
)
run_options.profiling = False
|