Home My Page Projects Code Snippets Project Openings SML/NJ
Summary Activity Forums Tracker Lists Tasks Docs Surveys News SCM Files

SCM Repository

[smlnj] Annotation of /admin/cvs2svn-smlnj.options
ViewVC logotype

Annotation of /admin/cvs2svn-smlnj.options

Parent Directory Parent Directory | Revision Log Revision Log


Revision 2087 - (view) (download)

1 : blume 2087 # (Be in -*- python -*- mode.)
2 :     #
3 :     # ====================================================================
4 :     # Copyright (c) 2006 CollabNet. All rights reserved.
5 :     #
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.
11 :     #
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 :     # ====================================================================
16 :    
17 :     # An options file like this can be used to configure cvs2svn. The
18 :     # file is in Python syntax, but you don't need to know Python to
19 :     # modify it. But if you *do* know Python, then you will be happy to
20 :     # know that you can use arbitary Python constructs to do fancy
21 :     # configuration tricks.
22 :    
23 :     # Two identifiers will have been defined before this file is executed,
24 :     # and can be used freely within this file:
25 :     #
26 :     # ctx -- a Ctx object (see cvs2svn_lib/context.py), which holds
27 :     # many configuration options
28 :     #
29 :     # run_options -- an instance of the OptionsFileRunOptions class
30 :     # (see cvs2svn_lib/run_options.py), which holds some variables
31 :     # governing how cvs2svn is run
32 :    
33 :    
34 :     # Import some modules that are used in setting the options:
35 :     import re
36 :    
37 :     from cvs2svn_lib.boolean import *
38 :     from cvs2svn_lib import config
39 :     from cvs2svn_lib.log import Log
40 :     from cvs2svn_lib.project import Project
41 :     from cvs2svn_lib.output_option import DumpfileOutputOption
42 :     from cvs2svn_lib.output_option import ExistingRepositoryOutputOption
43 :     from cvs2svn_lib.output_option import NewRepositoryOutputOption
44 :     from cvs2svn_lib.symbol_strategy import AllBranchRule
45 :     from cvs2svn_lib.symbol_strategy import AllTagRule
46 :     from cvs2svn_lib.symbol_strategy import BranchIfCommitsRule
47 :     from cvs2svn_lib.symbol_strategy import ExcludeRegexpStrategyRule
48 :     from cvs2svn_lib.symbol_strategy import ForceBranchRegexpStrategyRule
49 :     from cvs2svn_lib.symbol_strategy import ForceTagRegexpStrategyRule
50 :     from cvs2svn_lib.symbol_strategy import HeuristicStrategyRule
51 :     from cvs2svn_lib.symbol_strategy import RuleBasedSymbolStrategy
52 :     from cvs2svn_lib.symbol_strategy import UnambiguousUsageRule
53 :     from cvs2svn_lib.symbol_transform import RegexpSymbolTransform
54 :     from cvs2svn_lib.property_setters import AutoPropsPropertySetter
55 :     from cvs2svn_lib.property_setters import BinaryFileDefaultMimeTypeSetter
56 :     from cvs2svn_lib.property_setters import BinaryFileEOLStyleSetter
57 :     from cvs2svn_lib.property_setters import CVSRevisionNumberSetter
58 :     from cvs2svn_lib.property_setters import DefaultEOLStyleSetter
59 :     from cvs2svn_lib.property_setters import EOLStyleFromMimeTypeSetter
60 :     from cvs2svn_lib.property_setters import ExecutablePropertySetter
61 :     from cvs2svn_lib.property_setters import KeywordsPropertySetter
62 :     from cvs2svn_lib.property_setters import MimeMapper
63 :    
64 :    
65 :     # To choose the level of logging output, uncomment one of the
66 :     # following lines:
67 :     #Log().log_level = Log.WARN
68 :     #Log().log_level = Log.QUIET
69 :     Log().log_level = Log.NORMAL
70 :     #Log().log_level = Log.VERBOSE
71 :    
72 :    
73 :     # There are several possible options for where to put the output of a
74 :     # cvs2svn conversion. Please choose one of the following and adjust
75 :     # the parameters as necessary:
76 :    
77 :     # Use this output option if you would like cvs2svn to create a new SVN
78 :     # repository and store the converted repository there. The first
79 :     # argument is the path to which the repository should be written (this
80 :     # repository must not already exist). The second (optional) argument
81 :     # allows a --fs-type option to be passed to "svnadmin create". The
82 :     # third (optional) argument can be specified to set the
83 :     # --bdb-txn-nosync option on a bdb repository:
84 :     ctx.output_option = NewRepositoryOutputOption(
85 :     'smlnj-svn-sml', # Path to repository
86 :     #fs_type='fsfs', # Type of repository to create
87 :     #bdb_txn_nosync=False, # For bsd repositories, this option can be added
88 :     )
89 :    
90 :     # Use this output option if you would like cvs2svn to store the
91 :     # converted CVS repository into an SVN repository that already exists.
92 :     # The argument is the filesystem path of an existing local SVN
93 :     # repository (this repository must already exist):
94 :     #ctx.output_option = ExistingRepositoryOutputOption(
95 :     # 'svnrepo', # Path to repository
96 :     # )
97 :    
98 :     # Use this type of output option if you want the output of the
99 :     # conversion to be written to a SVN dumpfile instead of committing
100 :     # them into an actual repository:
101 :     #ctx.output_option = DumpfileOutputOption(
102 :     # dumpfile_path='cvs2svn-dump', # Name of dumpfile to create
103 :     # )
104 :    
105 :    
106 :     # Independent of the ctx.output_option selected, the following option
107 :     # can be set to True to suppress cvs2svn output altogether:
108 :     ctx.dry_run = False
109 :    
110 :     # Change the following if cvs2svn should use "cvs" to read file
111 :     # versions out of *,v files. (The default is to use "co", which is
112 :     # part of RCS, and is much faster):
113 :     ctx.use_cvs = False
114 :    
115 :     # Set the name (and optionally the path) of some executables required
116 :     # by cvs2svn. 'co' is needed by default; 'cvs' is needed if
117 :     # ctx.use_cvs is set to True:
118 :     ctx.svnadmin_executable = 'svnadmin'
119 :     ctx.co_executable = 'co'
120 :     ctx.cvs_executable = 'cvs'
121 :     ctx.sort_executable = 'sort'
122 :    
123 :     # Change the following line to True if the conversion should only
124 :     # include the trunk of the repository (i.e., all branches and tags
125 :     # should be ignored):
126 :     ctx.trunk_only = False
127 :    
128 :     # Change the following line to True if cvs2svn should delete a
129 :     # directory once the last file has been deleted from it:
130 :     ctx.prune = True
131 :    
132 :     # A list of encodings that should be tried when converting filenames,
133 :     # author names, log messages, etc. to UTF8. The encoders are tried in
134 :     # order in 'strict' mode until one of them succeeds. If none
135 :     # succeeds, then ctx.fallback_encoding is used in lossy 'replace' mode
136 :     # (if it is configured):
137 :     ctx.encoding = [
138 :     #'latin1',
139 :     'ascii',
140 :     ]
141 :    
142 :     # The encoding to use if all of the encodings listed in ctx.encoding
143 :     # fail. This encoding is used in 'replace' mode, which always
144 :     # succeeds but can cause information loss. To enable this feature,
145 :     # set the following value to the name of the desired encoding (e.g.,
146 :     # 'ascii').
147 :     ctx.fallback_encoding = None
148 :    
149 :     # The basic strategy for converting symbols (this should usually be
150 :     # left unchanged). A CVS symbol might be used as a tag in one file
151 :     # and as a branch in another file. The purpose of ctx.symbol_strategy
152 :     # is to determine whether to convert a particular symbol as a tag or
153 :     # as a branch.
154 :    
155 :     # A RuleBasedSymbolStrategy decides about each symbol based on a list
156 :     # of rules. Rules can be added to this object. The rules are tried
157 :     # one by one in order; the first rule that matches a given symbol is
158 :     # used. It is a fatal error if no rule matches a symbol.
159 :     ctx.symbol_strategy = RuleBasedSymbolStrategy()
160 :    
161 :     # To force all symbols matching a regular expression to be converted
162 :     # as branches, add rules like the following:
163 :     #ctx.symbol_strategy.add_rule(ForceBranchRegexpStrategyRule('branch.*'))
164 :    
165 :     # retain certain branches
166 :     ctx.symbol_strategy.add_rule(ForceBranchRegexpStrategyRule('blume-private-devel'))
167 :     ctx.symbol_strategy.add_rule(ForceBranchRegexpStrategyRule('shao-private-devel'))
168 :     ctx.symbol_strategy.add_rule(ForceBranchRegexpStrategyRule('idlbasis-devel'))
169 :     ctx.symbol_strategy.add_rule(ForceBranchRegexpStrategyRule('primop-branch-2'))
170 :     ctx.symbol_strategy.add_rule(ForceBranchRegexpStrategyRule('primop-branch'))
171 :     ctx.symbol_strategy.add_rule(ForceBranchRegexpStrategyRule('dbm-branch-2005_09_20'))
172 :     ctx.symbol_strategy.add_rule(ForceBranchRegexpStrategyRule('dbmdev1-branch'))
173 :    
174 :     ctx.symbol_strategy.add_rule(ForceBranchRegexpStrategyRule('SMLNJ'))
175 :     ctx.symbol_strategy.add_rule(ForceBranchRegexpStrategyRule('smlnj'))
176 :     ctx.symbol_strategy.add_rule(ForceBranchRegexpStrategyRule('FLINT'))
177 :     ctx.symbol_strategy.add_rule(ForceBranchRegexpStrategyRule('ckit'))
178 :    
179 :     # To force all symbols matching a regular expression to be converted
180 :     # as tags, add rules like the following:
181 :     #ctx.symbol_strategy.add_rule(ForceTagRegexpStrategyRule('tag.*'))
182 :    
183 :     # tag releases
184 :     ctx.symbol_strategy.add_rule(ForceTagRegexpStrategyRule('release-.*'))
185 :    
186 :     # To force all symbols matching a regular expression to be excluded
187 :     # from the conversion, add rules like the following:
188 :     #ctx.symbol_strategy.add_rule(ExcludeRegexpStrategyRule('unknown-.*'))
189 :    
190 :     # exclude everything else
191 :     ctx.symbol_strategy.add_rule(ExcludeRegexpStrategyRule('[a-z][a-z]*-[0-9][0-9]*-.*'))
192 :     ctx.symbol_strategy.add_rule(ExcludeRegexpStrategyRule('blume-head-tmp'))
193 :     ctx.symbol_strategy.add_rule(ExcludeRegexpStrategyRule('blume-orig-.*'))
194 :     ctx.symbol_strategy.add_rule(ExcludeRegexpStrategyRule('fang-shao-devel'))
195 :     ctx.symbol_strategy.add_rule(ExcludeRegexpStrategyRule('fang-shao-devel'))
196 :     ctx.symbol_strategy.add_rule(ExcludeRegexpStrategyRule('saha-.*'))
197 :     ctx.symbol_strategy.add_rule(ExcludeRegexpStrategyRule('flint-.*'))
198 :     ctx.symbol_strategy.add_rule(ExcludeRegexpStrategyRule('league-devel'))
199 :     ctx.symbol_strategy.add_rule(ExcludeRegexpStrategyRule('blume2001.*'))
200 :     ctx.symbol_strategy.add_rule(ExcludeRegexpStrategyRule('leunga-110_.*'))
201 :     ctx.symbol_strategy.add_rule(ExcludeRegexpStrategyRule('blume-110_.*'))
202 :     ctx.symbol_strategy.add_rule(ExcludeRegexpStrategyRule('mcz-.*'))
203 :     ctx.symbol_strategy.add_rule(ExcludeRegexpStrategyRule('Root2-mcz'))
204 :     ctx.symbol_strategy.add_rule(ExcludeRegexpStrategyRule('Release_.*'))
205 :     ctx.symbol_strategy.add_rule(ExcludeRegexpStrategyRule('v[0-9].*'))
206 :     ctx.symbol_strategy.add_rule(ExcludeRegexpStrategyRule('.*root.*'))
207 :     ctx.symbol_strategy.add_rule(ExcludeRegexpStrategyRule('.*tmp.*'))
208 :     ctx.symbol_strategy.add_rule(ExcludeRegexpStrategyRule('sml-mode-.*'))
209 :     ctx.symbol_strategy.add_rule(ExcludeRegexpStrategyRule('softs'))
210 :     ctx.symbol_strategy.add_rule(ExcludeRegexpStrategyRule('start'))
211 :     ctx.symbol_strategy.add_rule(ExcludeRegexpStrategyRule('.*export.*'))
212 :     ctx.symbol_strategy.add_rule(ExcludeRegexpStrategyRule('Version.*'))
213 :     ctx.symbol_strategy.add_rule(ExcludeRegexpStrategyRule('unlabeled.*'))
214 :     ctx.symbol_strategy.add_rule(ExcludeRegexpStrategyRule('local.*'))
215 :     ctx.symbol_strategy.add_rule(ExcludeRegexpStrategyRule('blume_.*'))
216 :     ctx.symbol_strategy.add_rule(ExcludeRegexpStrategyRule('MJM'))
217 :     ctx.symbol_strategy.add_rule(ExcludeRegexpStrategyRule('pre.*'))
218 :     ctx.symbol_strategy.add_rule(ExcludeRegexpStrategyRule('lal-.*'))
219 :     ctx.symbol_strategy.add_rule(ExcludeRegexpStrategyRule('home-.*'))
220 :     ctx.symbol_strategy.add_rule(ExcludeRegexpStrategyRule('b1.*'))
221 :     ctx.symbol_strategy.add_rule(ExcludeRegexpStrategyRule('blume-private-com.*'))
222 :     ctx.symbol_strategy.add_rule(ExcludeRegexpStrategyRule('blume-Release_.*'))
223 :     ctx.symbol_strategy.add_rule(ExcludeRegexpStrategyRule('debruijn'))
224 :     ctx.symbol_strategy.add_rule(ExcludeRegexpStrategyRule('release-110.8'))
225 :    
226 :     #ctx.symbol_strategy.add_rule(ExcludeRegexpStrategyRule('smlnj'))
227 :     #ctx.symbol_strategy.add_rule(ExcludeRegexpStrategyRule('FLINT'))
228 :     #ctx.symbol_strategy.add_rule(ExcludeRegexpStrategyRule('SMLNJ'))
229 :     #ctx.symbol_strategy.add_rule(ExcludeRegexpStrategyRule('ckit'))
230 :    
231 :     # Usually you want this rule, to convert unambiguous symbols (symbols
232 :     # that were only ever used as tags or only ever used as branches in
233 :     # CVS) the same way they were used in CVS:
234 :     #ctx.symbol_strategy.add_rule(UnambiguousUsageRule())
235 :    
236 :     # If there was ever a commit on a symbol, then it cannot be converted
237 :     # as a tag. Uncomment the following line to convert such symbols
238 :     # automatically as branches:
239 :     #ctx.symbol_strategy.add_rule(BranchIfCommitsRule())
240 :    
241 :     # Last in the list can be a catch-all rule that is used for symbols
242 :     # that were not matched by any of the more specific rules above.
243 :     # Include at most one of these lines. If none of these are included,
244 :     # then the presence of any ambiguous symbols (that haven't been
245 :     # disambiguated above) is an error:
246 :    
247 :     # Convert all ambiguous symbols as branches:
248 :     #ctx.symbol_strategy.add_rule(AllBranchRule())
249 :     # Convert all ambiguous symbols as tags:
250 :     #ctx.symbol_strategy.add_rule(AllTagRule())
251 :     # Convert ambiguous symbols based on whether they were used more
252 :     # often as branches or tags:
253 :     #ctx.symbol_strategy.add_rule(HeuristicStrategyRule())
254 :    
255 :     # 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:
256 :     ctx.username = None
257 :     #ctx.username = 'cvs2svn'
258 :    
259 :     # ctx.svn_property_setters contains a list of rules used to set the
260 :     # svn properties on files in the converted archive. For each file,
261 :     # the rules are tried one by one. Any rule can add or suppress one or
262 :     # more svn properties. Typically the rules will not overwrite
263 :     # properties set by a previous rule (though they are free to do so).
264 :     ctx.svn_property_setters = [
265 :     # Set the svn:executable flag on any files that are marked in CVS as
266 :     # being executable:
267 :     ExecutablePropertySetter(),
268 :    
269 :     # Omit the svn:eol-style property from any files that are listed as
270 :     # binary in CVS:
271 :     BinaryFileEOLStyleSetter(),
272 :    
273 :     # To read mime types from a file, uncomment the following line and
274 :     # specify a filename:
275 :     #MimeMapper('/etc/mime.types'),
276 :     MimeMapper('/etc/httpd/mime.types'),
277 :    
278 :     # To read auto-props rules from a file, uncomment the following line
279 :     # and specify a filename. The boolean argument specifies whether
280 :     # case should be ignored when matching filenames to the filename
281 :     # patterns found in the auto-props file:
282 :     #AutoPropsPropertySetter(
283 :     # '/home/username/.subversion/config',
284 :     # False,
285 :     # ),
286 :    
287 :     # If the file is binary and its svn:mime-type property is not yet
288 :     # set, set svn:mime-type to 'application/octet-stream'.
289 :     BinaryFileDefaultMimeTypeSetter(),
290 :    
291 :     # To try to determine the eol-style from the mime type, uncomment
292 :     # the following line:
293 :     #EOLStyleFromMimeTypeSetter(),
294 :    
295 :     # Choose one of the following lines to set the default svn:eol-style
296 :     # if none of the above rules applied. The argument is the
297 :     # svn:eol-style that should be applied, or None if no svn:eol-style
298 :     # should be set.
299 :     #DefaultEOLStyleSetter(None)
300 :     DefaultEOLStyleSetter('native'),
301 :    
302 :     # If svn:keywords has not been set yet, set it based on the file's
303 :     # CVS mode:
304 :     KeywordsPropertySetter(config.SVN_KEYWORDS_VALUE),
305 :    
306 :     # Uncomment the following line to include the original CVS revision
307 :     # numbers as file properties in the SVN archive:
308 :     #CVSRevisionNumberSetter(),
309 :    
310 :     ]
311 :    
312 :     # The directory to use for temporary files:
313 :     ctx.tmpdir = 'tmp'
314 :    
315 :     # To skip the cleanup of temporary files, uncomment the following
316 :     # option:
317 :     #ctx.skip_cleanup = True
318 :    
319 :     # To prevent CVS commits from different projects from being merged
320 :     # into single SVN commits, change this option to False:
321 :     ctx.cross_project_commits = True
322 :    
323 :     # Now use stanzas like the following to define CVS projects that
324 :     # should be converted. The arguments are:
325 :     #
326 :     # - The filesystem path of the project within the CVS repository.
327 :     #
328 :     # - The path that should be used for the "trunk" directory of this
329 :     # project within the SVN repository.
330 :     #
331 :     # - The path that should be used for the "branches" directory of this
332 :     # project within the SVN repository.
333 :     #
334 :     # - The path that should be used for the "tags" directory of this
335 :     # project within the SVN repository.
336 :     #
337 :     # - A list of symbol transformations that can be used to rename
338 :     # symbols in this project. Each entry is a tuple (pattern,
339 :     # replacement), where pattern is a Python regular expression pattern
340 :     # and replacement is the text that should replace the pattern. Each
341 :     # pattern is matched against each symbol name. If the pattern
342 :     # matches, then it is replaced with the corresponding replacement
343 :     # text. The replacement can include substitution patterns (e.g.,
344 :     # r'\1' or r'\g<name>'). Typically you will want to use raw strings
345 :     # (strings with a preceding 'r', like shown in the examples) for the
346 :     # regexp and its replacement to avoid backslash substitution within
347 :     # those strings."""
348 :    
349 :     # Create the default project (using ctx.trunk, ctx.branches, and ctx.tags):
350 :     ctx.add_project(
351 :     Project(
352 :     'sf-cvsrepos/sml',
353 :     'sml/trunk',
354 :     'sml/branches',
355 :     'sml/releases',
356 :     symbol_transforms=[
357 :     RegexpSymbolTransform(r'^Release_110_8$',
358 :     r'unlabeled-110.8-throwaway'),
359 :     RegexpSymbolTransform(r'^Release_(\d+)_(\d+)$',
360 :     r'release-\1.\2'),
361 :     #RegexpSymbolTransform(r'^release-(\d+)_(\d+)$',
362 :     # r'release-\1.\2'),
363 :     #RegexpSymbolTransform(r'^release-(\d+)_(\d+)_(\d+)$',
364 :     # r'release-\1.\2.\3'),
365 :     ],
366 :     )
367 :     )
368 :    
369 :     ctx.add_project(
370 :     Project(
371 :     'sf-cvsrepos/pages',
372 :     'pages/trunk',
373 :     'pages/branches',
374 :     'pages/releases',
375 :     symbol_transforms=[
376 :     RegexpSymbolTransform(r'^Release_110_8$',
377 :     r'unlabeled-110.8-throwaway'),
378 :     RegexpSymbolTransform(r'^Release_(\d+)_(\d+)$',
379 :     r'release-\1.\2'),
380 :     #RegexpSymbolTransform(r'^release-(\d+)_(\d+)$',
381 :     # r'release-\1.\2'),
382 :     #RegexpSymbolTransform(r'^release-(\d+)_(\d+)_(\d+)$',
383 :     # r'release-\1.\2.\3'),
384 :     ],
385 :     )
386 :     )
387 :    
388 :     ctx.add_project(
389 :     Project(
390 :     'sf-cvsrepos/bugs',
391 :     'bugs/trunk',
392 :     'bugs/branches',
393 :     'bugs/releases',
394 :     symbol_transforms=[
395 :     RegexpSymbolTransform(r'^Release_110_8$',
396 :     r'unlabeled-110.8-throwaway'),
397 :     RegexpSymbolTransform(r'^Release_(\d+)_(\d+)$',
398 :     r'release-\1.\2'),
399 :     #RegexpSymbolTransform(r'^release-(\d+)_(\d+)$',
400 :     # r'release-\1.\2'),
401 :     #RegexpSymbolTransform(r'^release-(\d+)_(\d+)_(\d+)$',
402 :     # r'release-\1.\2.\3'),
403 :     ],
404 :     )
405 :     )
406 :    
407 :     # Add a second project, to be stored to projA/trunk, projA/branches,
408 :     # and projA/tags:
409 :     #ctx.add_project(
410 :     # Project(
411 :     # 'my/cvsrepo/projA',
412 :     # 'projA/trunk',
413 :     # 'projA/branches',
414 :     # 'projA/tags',
415 :     # symbol_transforms=[
416 :     # #RegexpSymbolTransform(r'^release-(\d+)_(\d+)$',
417 :     # # r'release-\1.\2'),
418 :     # #RegexpSymbolTransform(r'^release-(\d+)_(\d+)_(\d+)$',
419 :     # # r'release-\1.\2.\3'),
420 :     # ],
421 :     # )
422 :     # )
423 :    
424 :     # Change this option to True to turn on profiling of cvs2svn (for
425 :     # debugging purposes):
426 :     run_options.profiling = False

root@smlnj-gforge.cs.uchicago.edu
ViewVC Help
Powered by ViewVC 1.0.0