[Kolab-devel] CVS to Mercurial conversion

Thomas Arendsen Hein thomas at intevation.de
Mon Sep 6 17:11:41 CEST 2010


* Thomas Arendsen Hein <thomas at intevation.de> [20100906 16:06]:
> Today is Monday and the migration just happened!

For reference and as an example for other people, here are the
details of the conversion:

The rsync command I used to get a copy of the CVS repository:
rsync -avP --exclude '**/Attic/*.tar.gz,v' --exclude '**/Attic/*.tgz,v' --exclude '**/Attic/*.tar.bz2,v' --exclude server/doc --delete --delete-excluded rsync://cvs.kolab.org/kolabcvs/ kolabcvs

I used revision 213e77a8201f (current version) of the cvs2hg flavor
of cvs2svn available at http://hg.gerg.ca/cvs2svn/ (and mirrored at
http://hg.intevation.org/mirrors/gerg.ca/cvs2svn/) with the attached
cvs2hg.options file:
cvs2hg --options=/path/to/cvs2hg.options

The diff to the included example config is:

--- cvs2hg-example.options	2010-09-06 17:09:48.544175322 +0200
+++ cvs2hg.options	2010-09-06 15:30:57.120199480 +0200
@@ -120,7 +120,7 @@
 
 
 # The directory to use for temporary files:
-ctx.tmpdir = r'cvs2svn-tmp'
+ctx.tmpdir = r'/local-vol1/thomas/kolab-hg-migration/tmp'
 
 # Choose one of the following three groups of lines
 # (see cvs2svn-example.options for details):
@@ -156,11 +156,11 @@
     )
 ctx.cvs_log_decoder = CVSTextDecoder(
     [
-        #'latin1',
-        #'utf8',
+        'utf8',
+        'latin1',
         'ascii',
         ],
-    #fallback_encoding='ascii'
+    fallback_encoding='ascii'
     )
 # You might want to be especially strict when converting filenames to
 # Unicode (e.g., maybe not specify a fallback_encoding).
@@ -260,6 +260,7 @@
     # To force all symbols matching a regular expression to be
     # excluded from the conversion, add rules like the following:
     #ExcludeRegexpStrategyRule(r'unknown-.*'),
+    ExcludeRegexpStrategyRule(r'start'),
 
     # Sometimes people use "cvs import" to get their own source code
     # into CVS.  This practice creates a vendor branch 1.1.1 and
@@ -317,7 +318,7 @@
 # account for CVS weirdness (e.g. fixup commits to make a Mercurial
 # tag describe exactly the same tree as its corresponding CVS tag).
 # This can be any Unicode or ASCII string.
-ctx.username = 'cvs2hg'
+ctx.username = 'cvs2hg <hg at kolab.org>'
 
 # ctx.file_property_setters and ctx.revision_property_setters contain
 # rules used to set the svn properties on files in the converted
@@ -448,22 +449,47 @@
 # substitute your own project's usernames here to use with the
 # author_transforms option of HgOutputOption below.
 author_transforms={
-    'jrandom' : ('J. Random', 'jrandom at example.com'),
-    'mhagger' : 'Michael Haggerty <mhagger at alum.mit.edu>',
-    'brane' : (u'Branko Čibej', 'brane at xbc.nu'),
-    'ringstrom' : 'Tobias Ringström <tobias at ringstrom.mine.nu>',
-    'dionisos' : (u'Erik Hülsmann', 'e.huelsmann at gmx.net'),
+    'thomas': 'Thomas Arendsen Hein <thomas at intevation.de>',
+    'wilde': 'Sascha Wilde <wilde at intevation.de>',
+    'achim': 'Achim Frank <achim.frank at erfrakon.de>',
+    'bernhard': 'Bernhard Reiter <bernhard at intevation.de>',
+    'bh': 'Bernhard Herzog <bh at intevation.de>',
+    'bo': 'Bo Thorsen <bo at klaralvdalens-datakonsult.se>',
+    'danimo': 'Daniel Molkentin <molkentin at kde.org>',
+    'david': 'David Faure <dfaure at kdab.com>',
+    'emanuel': 'Emanuel Schuetze <emanuel at intevation.de>',
+    'greve': 'Georg Greve <greve at kolabsys.com>',
+    'gunnar': 'Gunnar Wrobel <wrobel at pardus.de>',
+    'jan': 'Jan-Oliver Wagener <jan-oliver.wagner at intevation.de>',
+    'khruskowski': 'Karl-Heinz Ruskowski <khruskowski at intevation.de>',
+    'ljohansen': 'Lennart Johansen <ljohansen at intevation.de>',
+    'ludwig': 'Ludwig Reiter <ludwig.reiter at intevation.de>',
+    'marc': 'Marc Mutz <marc at kdab.com>',
+    'marcus': 'Marcus Hüwe <suse-tux at gmx.de>',
+    'martin': 'Martin Konold <martin.konold at erfrakon.de>',
+    'mathieu': 'Mathieu Parent <math.parent at gmail.com>',
+    'michel': 'Michel Boyer de la Giroday <michel at kdab.com>',
+    'richard': 'Richard Bos <richard at radoeka.nl>',
+    'romain': 'Romain Pokrzywka <romain at kdab.com>',
+    'schreiber': 'Arne Schreiber <arne at kdab.com>',
+    'steffen': 'Steffen Hansen <steffen at kdab.com>',
+    'stephan': 'Stephan Buys <s.buys at codefusion.co.za>',
+    'stuart': 'Stuart Bingë <s.binge at codefusion.co.za>',
+    'tassilo': 'Tassilo Erlewein <tassilo.erlewein at erfrakon.de>',
+    'till': 'Till Adam <till at kdab.com>',
+    'tobias': 'Tobias Larsson <tobias at klaralvdalens-datakonsult.se>',
+    'torsten': 'Torsten Irländer <torsten.irlaender at intevation.de>',
 
     # This one will be used for commits for which CVS doesn't record
     # the original author, as explained above.
-    'cvs2svn' : 'cvs2svn <admin at example.com>',
+    'cvs2hg' : 'cvs2hg <hg at kolab.org>',
     }
 
 # This is the main option that causes cvs2svn to write to a Mercurial
 # repository rather than to Subversion:
 ctx.output_option = HgOutputOption(
     # The Mercurial repository to write to; must not exist.
-    os.path.join(ctx.tmpdir, 'main.hg'),
+    os.path.join(ctx.tmpdir, 'server.hg'),
 
     # Optional map from CVS author names to Mercurial author names:
     author_transforms=author_transforms,
@@ -483,7 +509,8 @@
     # http://pypi.python.org/pypi/pytz/).
     #
     # The default timezone is UTC.
-    timezone=None,
+    #timezone=None,
+    timezone='Europe/Berlin',
 
     # Control how/when to create fixup commits, which are artificial
     # changesets to account for CVS tags/branches that do not reference
@@ -495,8 +522,8 @@
     #  'sloppy': like optional, but further suppress fixups that only
     #    remove files (this is to account for the CVS practice of tagging
     #    or branching only part of a source tree)
-    branch_fixup_mode='always',
-    tag_fixup_mode='optional',
+    branch_fixup_mode='sloppy',
+    tag_fixup_mode='sloppy',
 
     )
 
@@ -522,7 +549,7 @@
     # The filesystem path to the part of the CVS repository (*not* a
     # CVS working copy) that should be converted.  This may be a
     # subdirectory (i.e., a module) within a larger CVS repository.
-    r'test-data/main-cvsrepos',
+    r'/local-vol1/thomas/kolab-hg-migration/kolabcvs/server',
 
     # A list of symbol transformations that can be used to rename
     # symbols in this project.
@@ -553,6 +580,23 @@
         #                      r'release-\1.\2'),
         #RegexpSymbolTransform(r'release-(\d+)_(\d+)_(\d+)',
         #                      r'release-\1.\2.\3'),
+        RegexpSymbolTransform(r'KOLAB_1_0', r'1.0-stable'),
+        RegexpSymbolTransform(r'Kolab_1_x', r'1.x-stable'),
+        RegexpSymbolTransform(r'kolab_(\d)_(\d)_branch', r'\1.\2-stable'),
+        RegexpSymbolTransform(r'suc_branch', r'2.2-feature-suc'),
+        RegexpSymbolTransform(r'kolab-server-(\d)-(\d)-(\d)', r'\1.\2.\3'),
+        RegexpSymbolTransform(r'kolab-server-(\d)-(\d)-(\d)-(rc|beta)-(\d)', r'\1.\2.\3-\4\5'),
+        RegexpSymbolTransform(r'kolab-server-(\d)-(\d)-(rc|beta)-(\d)', r'\1.\2-\3\4'),
+        RegexpSymbolTransform(r'BEFORE_KONSEC_ADMIN', r'1.0-before_konsec_admin'),
+        RegexpSymbolTransform(r'AFTER_KONSEC_ADMIN', r'1.0-after_konsec_admin'),
+        RegexpSymbolTransform(r'V1-0-BETA-2', r'1.0-beta2'),
+        RegexpSymbolTransform(r'kroupware', r'1.0-kroupware'),
+        RegexpSymbolTransform(r'proko2_m1', r'2.0-proko2_m1'),
+        RegexpSymbolTransform(r'proko2_m2c', r'2.0-proko2_m2c'),
+        RegexpSymbolTransform(r'proko2_m3', r'2.0-proko2_m3'),
+        RegexpSymbolTransform(r'pre_autoperl', r'2.0-pre_autoperl'),
+        RegexpSymbolTransform(r'kolab2', r'2.0-kolabd'),
+        RegexpSymbolTransform(r'kolab_2_0_tag', r'2.0.0'),
 
         # Simple 1:1 character replacements can also be done.  The
         # following transform, which converts backslashes into forward

-- 
thomas at intevation.de - http://intevation.de/~thomas/ - OpenPGP key: 0x5816791A
Intevation GmbH, Neuer Graben 17, 49074 Osnabrueck - AG Osnabrueck, HR B 18998
Geschaeftsfuehrer: Frank Koormann, Bernhard Reiter, Dr. Jan-Oliver Wagner
-------------- next part --------------
# (Be in -*- mode: python; coding: utf-8 -*- mode.)
#
# ====================================================================
# Copyright (c) 2006-2009 CollabNet.  All rights reserved.
#
# This software is licensed as described in the file COPYING, which
# you should have received as part of this distribution.  The terms
# are also available at http://subversion.tigris.org/license-1.html.
# If newer versions of this license are posted there, you may use a
# newer version instead, at your option.
#
# This software consists of voluntary contributions made by many
# individuals.  For exact contribution history, see the revision
# history and logs, available at http://cvs2svn.tigris.org/.
# ====================================================================

#                  #####################
#                  ## PLEASE READ ME! ##
#                  #####################
#
# This is a template for an options file that can be used to configure
# cvs2svn to convert to Mercurial rather than to Subversion.  See
# www/cvs2git.html and www/cvs2svn.html for general information, and
# see the comments in this file for information about what options are
# available and how they can be set.
#
# The program that is run to convert from CVS to Mercurial is called
# cvs2hg.  Run it with the --options option, passing it this file as
# argument:
#
#     cvs2hg --options=cvs2hg-example.options
#
# The output of cvs2hg is a Mercurial repository.  Please see
# README.cvs2hg for more information.
# Many options do not have defaults, so it is easier to copy this file
# and modify what you need rather than creating a new options file
# from scratch.  This file is in Python syntax, but you don't need to
# know Python to modify it.  But if you *do* know Python, then you
# will be happy to know that you can use arbitary Python constructs to
# do fancy configuration tricks.
#
# But please be aware of the following:
#
# * In many places, leading whitespace is significant in Python (it is
#   used instead of curly braces to group statements together).
#   Therefore, if you don't know what you are doing, it is best to
#   leave the whitespace as it is.
#
# * In normal strings, Python treats a backslash ("\") as an escape
#   character.  Therefore, if you want to specify a string that
#   contains a backslash, you need either to escape the backslash with
#   another backslash ("\\"), or use a "raw string", as in one if the
#   following equivalent examples:
#
#       cvs_executable = 'c:\\windows\\system32\\cvs.exe'
#       cvs_executable = r'c:\windows\system32\cvs.exe'
#
#   See http://docs.python.org/tutorial/introduction.html#strings for
#   more information.
#
# 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 GitRunOptions class (see
#         cvs2svn_lib/git_run_options.py), which holds some variables
#         governing how cvs2git is run


# Import some modules that are used in setting the options:
import os

from cvs2svn_lib import config
from cvs2svn_lib import changeset_database
from cvs2svn_lib.common import CVSTextDecoder
from cvs2svn_lib.log import logger
from cvs2svn_lib.project import Project
from cvs2svn_lib.hg_output_option import HgOutputOption
from cvs2svn_lib.dvcs_common import KeywordHandlingPropertySetter
from cvs2svn_lib.revision_manager import NullRevisionCollector
from cvs2svn_lib.rcs_revision_manager import RCSRevisionReader
from cvs2svn_lib.cvs_revision_manager import CVSRevisionReader
from cvs2svn_lib.checkout_internal import InternalRevisionCollector
from cvs2svn_lib.checkout_internal import InternalRevisionReader
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 ExcludeTrivialImportBranchRule
from cvs2svn_lib.symbol_strategy import ExcludeVendorBranchRule
from cvs2svn_lib.symbol_strategy import HeuristicStrategyRule
from cvs2svn_lib.symbol_strategy import UnambiguousUsageRule
from cvs2svn_lib.symbol_strategy import HeuristicPreferredParentRule
from cvs2svn_lib.symbol_strategy import SymbolHintsFileRule
from cvs2svn_lib.symbol_transform import ReplaceSubstringsSymbolTransform
from cvs2svn_lib.symbol_transform import RegexpSymbolTransform
from cvs2svn_lib.symbol_transform import IgnoreSymbolTransform
from cvs2svn_lib.symbol_transform import NormalizePathsSymbolTransform
from cvs2svn_lib.property_setters import AutoPropsPropertySetter
from cvs2svn_lib.property_setters import CVSBinaryFileDefaultMimeTypeSetter
from cvs2svn_lib.property_setters import CVSBinaryFileEOLStyleSetter
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
from cvs2svn_lib.property_setters import SVNBinaryFileKeywordsPropertySetter

# To choose the level of logging output, uncomment one of the
# following lines:
#logger.log_level = logger.WARN
#logger.log_level = logger.QUIET
logger.log_level = logger.NORMAL
#logger.log_level = logger.VERBOSE
#logger.log_level = logger.DEBUG


# The directory to use for temporary files:
ctx.tmpdir = r'/local-vol1/thomas/kolab-hg-migration/tmp'

# Choose one of the following three groups of lines
# (see cvs2svn-example.options for details):
ctx.revision_collector = InternalRevisionCollector(compress=True)
ctx.revision_reader = InternalRevisionReader(compress=True)

#ctx.revision_collector = NullRevisionCollector()
#ctx.revision_reader = RCSRevisionReader(co_executable=r'co')

#ctx.revision_collector = NullRevisionCollector()
#ctx.revision_reader = CVSRevisionReader(cvs_executable=r'cvs')


# 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 omitted from the conversion):
ctx.trunk_only = False

# How to convert CVS author names, log messages, and filenames to
# Unicode.  The first argument to CVSTextDecoder is a list of encoders
# that are tried in order in 'strict' mode until one of them succeeds.
# If none of those succeeds, then fallback_encoder (if it is
# specified) is used in lossy 'replace' mode.  Setting a fallback
# encoder ensures that the encoder always succeeds, but it can cause
# information loss.
ctx.cvs_author_decoder = CVSTextDecoder(
    [
        #'latin1',
        #'utf8',
        'ascii',
        ],
    #fallback_encoding='ascii'
    )
ctx.cvs_log_decoder = CVSTextDecoder(
    [
        'utf8',
        'latin1',
        'ascii',
        ],
    fallback_encoding='ascii'
    )
# You might want to be especially strict when converting filenames to
# Unicode (e.g., maybe not specify a fallback_encoding).
ctx.cvs_filename_decoder = CVSTextDecoder(
    [
        #'latin1',
        #'utf8',
        'ascii',
        ],
    #fallback_encoding='ascii'
    )

# Template for the commit message to be used for tag/branch fixup
# changesets.  This message can use '%(symbol_type)s' to include the
# type of the symbol ('branch' or 'tag') and/or '%(symbol_name)s' to
# include the name of the symbol.
ctx.symbol_commit_message = (
    "fixup commit for %(symbol_type)s '%(symbol_name)s'"
    )

# Template for the commit message to be used for post commits, in
# which modifications to a vendor branch are copied back to trunk.
# This message can use '%(revnum)s' to include the changeset id
# of the revision that included the change to the vendor branch.
ctx.post_commit_message = (
    "artificial commit to compensate for changes in %(revnum)s from "
    "a CVS vendor branch"
    )

# Some CVS clients for MacOS store resource fork data into CVS along
# with the file contents itself by wrapping it all up in a container
# format called "AppleSingle".  Subversion currently does not support
# MacOS resource forks.  Nevertheless, sometimes the resource fork
# information is not necessary and can be discarded.  Set the
# following option to True if you would like cvs2svn to identify files
# whose contents are encoded in AppleSingle format, and discard all
# but the data fork for such files before committing them to
# Subversion.  (Please note that AppleSingle contents are identified
# by the AppleSingle magic number as the first four bytes of the file.
# This check is not failproof, so only set this option if you think
# you need it.)
ctx.decode_apple_single = False

# This option can be set to the name of a filename to which are stored
# statistics and conversion decisions about the CVS symbols.
ctx.symbol_info_filename = None
#ctx.symbol_info_filename = 'symbol-info.txt'

# cvs2svn uses "symbol strategy rules" to help decide how to handle
# CVS symbols.  The rules in a project's symbol_strategy_rules are
# applied in order, and each rule is allowed to modify the symbol.
# The result (after each of the rules has been applied) is used for
# the conversion.
#
# 1. A CVS symbol might be used as a tag in one file and as a branch
#    in another file.  cvs2svn has to decide whether to convert such a
#    symbol as a tag or as a branch.  cvs2svn uses a series of
#    heuristic rules to decide how to convert a symbol.  The user can
#    override the default rules for specific symbols or symbols
#    matching regular expressions.
#
# 2. cvs2svn is also capable of excluding symbols from the conversion
#    (provided no other symbols depend on them.
#
# 3. CVS does not record unambiguously the line of development from
#    which a symbol sprouted.  cvs2svn uses a heuristic to choose a
#    symbol's "preferred parents".
#
# The standard branch/tag/exclude StrategyRules do not change a symbol
# that has already been processed by an earlier rule, so in effect the
# first matching rule is the one that is used.

global_symbol_strategy_rules = [
    # It is possible to specify manually exactly how symbols should be
    # converted and what line of development should be used as the
    # preferred parent.  To do so, create a file containing the symbol
    # hints and enable the following option.
    #
    # The format of the hints file is described in the documentation
    # for the --symbol-hints command-line option.  The file output by
    # the --write-symbol-info (i.e., ctx.symbol_info_filename) option
    # is in the same format.  The simplest way to use this option is
    # to run the conversion through CollateSymbolsPass with
    # --write-symbol-info option, copy the symbol info and edit it to
    # create a hints file, then re-start the conversion at
    # CollateSymbolsPass with this option enabled.
    #SymbolHintsFileRule('symbol-hints.txt'),

    # To force all symbols matching a regular expression to be
    # converted as branches, add rules like the following:
    #ForceBranchRegexpStrategyRule(r'branch.*'),

    # To force all symbols matching a regular expression to be
    # converted as tags, add rules like the following:
    #ForceTagRegexpStrategyRule(r'tag.*'),

    # To force all symbols matching a regular expression to be
    # excluded from the conversion, add rules like the following:
    #ExcludeRegexpStrategyRule(r'unknown-.*'),
    ExcludeRegexpStrategyRule(r'start'),

    # Sometimes people use "cvs import" to get their own source code
    # into CVS.  This practice creates a vendor branch 1.1.1 and
    # imports the code onto the vendor branch as 1.1.1.1, then copies
    # the same content to the trunk as version 1.1.  Normally, such
    # vendor branches are useless and they complicate the SVN history
    # unnecessarily.  The following rule excludes any branches that
    # only existed as a vendor branch with a single import (leaving
    # only the 1.1 revision).  If you want to retain such branches,
    # comment out the following line.  (Please note that this rule
    # does not exclude vendor *tags*, as they are not so easy to
    # identify.)
    ExcludeTrivialImportBranchRule(),

    # To exclude all vendor branches (branches that had "cvs import"s
    # on them but no other kinds of commits), uncomment the following
    # line:
    #ExcludeVendorBranchRule(),

    # 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:
    UnambiguousUsageRule(),

    # If there was ever a commit on a symbol, then it cannot be
    # converted as a tag.  This rule causes all such symbols to be
    # converted as branches.  If you would like to resolve such
    # ambiguities manually, comment out the following line:
    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.  (Assuming that BranchIfCommitsRule() was included above,
    # then the symbols that are still indeterminate at this point can
    # sensibly be converted as branches or tags.)  Include at most one
    # of these lines.  If none of these catch-all rules are included,
    # then the presence of any ambiguous symbols (that haven't been
    # disambiguated above) is an error:

    # Convert ambiguous symbols based on whether they were used more
    # often as branches or as tags:
    HeuristicStrategyRule(),
    # Convert all ambiguous symbols as branches:
    #AllBranchRule(),
    # Convert all ambiguous symbols as tags:
    #AllTagRule(),

    # The last rule is here to choose the preferred parent of branches
    # and tags, that is, the line of development from which the symbol
    # sprouts.
    HeuristicPreferredParentRule(),
    ]

# Specify a username to be used for artificial commits created to
# account for CVS weirdness (e.g. fixup commits to make a Mercurial
# tag describe exactly the same tree as its corresponding CVS tag).
# This can be any Unicode or ASCII string.
ctx.username = 'cvs2hg <hg at kolab.org>'

# ctx.file_property_setters and ctx.revision_property_setters contain
# 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.file_property_setters should be used for
# properties that remain the same for the life of the file; these
# should implement FilePropertySetter.  ctx.revision_property_setters
# should be used for properties that are allowed to vary from revision
# to revision; these should implement RevisionPropertySetter.
#
# Obviously, SVN properties per se are not interesting for a cvs2hg
# conversion, but some of these properties have side-effects that do
# affect the Mercurial output.  FIXME: Document this in more detail.
ctx.file_property_setters.extend([
    # 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(
    #    r'/home/username/.subversion/config',
    #    ignore_case=True,
    #    ),

    # To read mime types from a file, uncomment the following line and
    # specify a filename:
    #MimeMapper(r'/etc/mime.types', ignore_case=False),

    # Omit the svn:eol-style property from any files that are listed
    # as binary (i.e., mode '-kb') in CVS:
    CVSBinaryFileEOLStyleSetter(),

    # If the file is binary and its svn:mime-type property is not yet
    # set, set svn:mime-type to 'application/octet-stream'.
    CVSBinaryFileDefaultMimeTypeSetter(),

    # 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 (i.e., the file should be treated as
    # binary).
    #
    # The default is to treat all files as binary unless one of the
    # previous rules has determined otherwise, because this is the
    # safest approach.  However, if you have been diligent about
    # marking binary files with -kb in CVS and/or you have used the
    # above rules to definitely mark binary files as binary, then you
    # might prefer to use 'native' as the default, as it is usually
    # the most convenient setting for text files.  Other possible
    # options: 'CRLF', 'CR', 'LF'.
    DefaultEOLStyleSetter(None),
    #DefaultEOLStyleSetter('native'),

    # Prevent svn:keywords from being set on files that have
    # svn:eol-style unset.
    SVNBinaryFileKeywordsPropertySetter(),

    # If svn:keywords has not been set yet, set it based on the file's
    # CVS mode:
    KeywordsPropertySetter(config.SVN_KEYWORDS_VALUE),

    # Set the svn:executable flag on any files that are marked in CVS as
    # being executable:
    ExecutablePropertySetter(),

    # The following causes keywords to be collapsed in all text to be
    # committed:
    KeywordHandlingPropertySetter('collapsed'),

    ])
ctx.revision_property_setters.extend([
    ])

# To skip the cleanup of temporary files, uncomment the following
# option:
#ctx.skip_cleanup = True


# In CVS, it is perfectly possible to make a single commit that
# affects more than one project or more than one branch of a single
# project.  Subversion also allows such commits.  Therefore, by
# default, when cvs2svn sees what looks like a cross-project or
# cross-branch CVS commit, it converts it into a
# cross-project/cross-branch Subversion commit.
#
# However, other tools and SCMs have trouble representing
# cross-project or cross-branch commits.  (For example, Trac's Revtree
# plugin, http://www.trac-hacks.org/wiki/RevtreePlugin is confused by
# such commits.)  Therefore, we provide the following two options to
# allow cross-project/cross-branch commits to be suppressed.

# cvs2hg only supports single-project conversions (multiple-project
# conversions wouldn't really make sense for hg anyway).  So this
# option must be set to False:
ctx.cross_project_commits = False

# Mercurial itself doesn't allow commits that affect more than one
# branch, so this option must be set to False:
ctx.cross_branch_commits = False

# cvs2hg does not yet handle translating .cvsignore files into
# .hgignore content, so by default, the .cvsignore files are included
# inthe conversion output.  If you would like to omit the .cvsignore
# files from the output, set this option to False:
ctx.keep_cvsignore = True

# By default, it is a fatal error for a CVS ",v" file to appear both
# inside and outside of an "Attic" subdirectory (this should never
# happen, but frequently occurs due to botched repository
# administration).  If you would like to retain both versions of such
# files, change the following option to True, and the attic version of
# the file will be written to a subdirectory called "Attic" in the
# output repository:
ctx.retain_conflicting_attic_files = False

# CVS uses unix login names as author names whereas Mercurial allows any
# string (conventionally of the form "Real Name <email at domain>").  The
# default is to leave CVS author names as-is.  author_transforms can be
# used to map cvs author names (e.g., "jrandom") to a true name and
# email address (e.g., "J. Random <jrandom at example.com>" for the example
# shown).  All values should be either Unicode strings (i.e., with "u"
# as a prefix) or 8-bit strings in the UTF-8 encoding.  Please
# substitute your own project's usernames here to use with the
# author_transforms option of HgOutputOption below.
author_transforms={
    'thomas': 'Thomas Arendsen Hein <thomas at intevation.de>',
    'wilde': 'Sascha Wilde <wilde at intevation.de>',
    'achim': 'Achim Frank <achim.frank at erfrakon.de>',
    'bernhard': 'Bernhard Reiter <bernhard at intevation.de>',
    'bh': 'Bernhard Herzog <bh at intevation.de>',
    'bo': 'Bo Thorsen <bo at klaralvdalens-datakonsult.se>',
    'danimo': 'Daniel Molkentin <molkentin at kde.org>',
    'david': 'David Faure <dfaure at kdab.com>',
    'emanuel': 'Emanuel Schuetze <emanuel at intevation.de>',
    'greve': 'Georg Greve <greve at kolabsys.com>',
    'gunnar': 'Gunnar Wrobel <wrobel at pardus.de>',
    'jan': 'Jan-Oliver Wagener <jan-oliver.wagner at intevation.de>',
    'khruskowski': 'Karl-Heinz Ruskowski <khruskowski at intevation.de>',
    'ljohansen': 'Lennart Johansen <ljohansen at intevation.de>',
    'ludwig': 'Ludwig Reiter <ludwig.reiter at intevation.de>',
    'marc': 'Marc Mutz <marc at kdab.com>',
    'marcus': 'Marcus Hüwe <suse-tux at gmx.de>',
    'martin': 'Martin Konold <martin.konold at erfrakon.de>',
    'mathieu': 'Mathieu Parent <math.parent at gmail.com>',
    'michel': 'Michel Boyer de la Giroday <michel at kdab.com>',
    'richard': 'Richard Bos <richard at radoeka.nl>',
    'romain': 'Romain Pokrzywka <romain at kdab.com>',
    'schreiber': 'Arne Schreiber <arne at kdab.com>',
    'steffen': 'Steffen Hansen <steffen at kdab.com>',
    'stephan': 'Stephan Buys <s.buys at codefusion.co.za>',
    'stuart': 'Stuart Bingë <s.binge at codefusion.co.za>',
    'tassilo': 'Tassilo Erlewein <tassilo.erlewein at erfrakon.de>',
    'till': 'Till Adam <till at kdab.com>',
    'tobias': 'Tobias Larsson <tobias at klaralvdalens-datakonsult.se>',
    'torsten': 'Torsten Irländer <torsten.irlaender at intevation.de>',

    # This one will be used for commits for which CVS doesn't record
    # the original author, as explained above.
    'cvs2hg' : 'cvs2hg <hg at kolab.org>',
    }

# This is the main option that causes cvs2svn to write to a Mercurial
# repository rather than to Subversion:
ctx.output_option = HgOutputOption(
    # The Mercurial repository to write to; must not exist.
    os.path.join(ctx.tmpdir, 'server.hg'),

    # Optional map from CVS author names to Mercurial author names:
    author_transforms=author_transforms,

    # CVS stores timestamps in UTC with no timezone.  Mercurial timestamps
    # are also UTC, but with the timezone from when each commit was made.
    # If all of your commits were made from the same timezone (or if you are
    # willing to pretend that they were), then you can tell cvs2hg to use
    # that timezone in the timestamp for every commit.
    #
    # timezone can be an integer (seconds east of UTC) or a timezone name
    # (e.g. 'Canada/Eastern' or 'Europe/Berlin').  If you just supply an
    # integer offset, it is always used regardless of daylight savings time
    # -- so it really only makes sense if all your CVS commits happened in a
    # jurisdiction without daylight savings time.  If you supply a timezone
    # name, you must install the pytz library (see
    # http://pypi.python.org/pypi/pytz/).
    #
    # The default timezone is UTC.
    #timezone=None,
    timezone='Europe/Berlin',

    # Control how/when to create fixup commits, which are artificial
    # changesets to account for CVS tags/branches that do not reference
    # a single point in history.  Allowed values:
    #  'always': always create fixups, whether they are needed or not
    #  'optional': only create fixups when necessary (i.e. if a CVS
    #    tag or branch references a single point in history, there
    #    will be no fixup for that tag or branch)
    #  'sloppy': like optional, but further suppress fixups that only
    #    remove files (this is to account for the CVS practice of tagging
    #    or branching only part of a source tree)
    branch_fixup_mode='sloppy',
    tag_fixup_mode='sloppy',

    )

# Change this option to True to turn on profiling of cvs2svn (for
# debugging purposes):
run_options.profiling = False


# Should CVSItem -> Changeset database files be memory mapped?  In
# some tests, using memory mapping speeded up the overall conversion
# by about 5%.  But this option can cause the conversion to fail with
# an out of memory error if the conversion computer runs out of
# virtual address space (e.g., when running a very large conversion on
# a 32-bit operating system).  Therefore it is disabled by default.
# Uncomment the following line to allow these database files to be
# memory mapped.
#changeset_database.use_mmap_for_cvs_item_to_changeset_table = True

# Now set the project to be converted to Mercurial.  cvs2hg only
# supports single-project conversions, so this method must only be
# called once:
run_options.set_project(
    # The filesystem path to the part of the CVS repository (*not* a
    # CVS working copy) that should be converted.  This may be a
    # subdirectory (i.e., a module) within a larger CVS repository.
    r'/local-vol1/thomas/kolab-hg-migration/kolabcvs/server',

    # A list of symbol transformations that can be used to rename
    # symbols in this project.
    symbol_transforms=[
        # Use IgnoreSymbolTransforms like the following to completely
        # ignore symbols matching a regular expression when parsing
        # the CVS repository, for example to avoid warnings about
        # branches with two names and to choose the preferred name.
        # It is *not* recommended to use this instead of
        # ExcludeRegexpStrategyRule; though more efficient,
        # IgnoreSymbolTransforms are less flexible and don't exclude
        # branches correctly.  The argument is a Python-style regular
        # expression that has to match the *whole* CVS symbol name:
        #IgnoreSymbolTransform(r'nightly-build-tag-.*')

        # RegexpSymbolTransforms transform symbols textually using a
        # regular expression.  The first argument is a Python regular
        # expression pattern and the second is a replacement pattern.
        # The pattern is matched against each symbol name.  If it
        # matches the whole symbol name, then the symbol name is
        # replaced with the corresponding replacement text.  The
        # replacement can include substitution patterns (e.g., r'\1'
        # or r'\g<name>').  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.
        #RegexpSymbolTransform(r'release-(\d+)_(\d+)',
        #                      r'release-\1.\2'),
        #RegexpSymbolTransform(r'release-(\d+)_(\d+)_(\d+)',
        #                      r'release-\1.\2.\3'),
        RegexpSymbolTransform(r'KOLAB_1_0', r'1.0-stable'),
        RegexpSymbolTransform(r'Kolab_1_x', r'1.x-stable'),
        RegexpSymbolTransform(r'kolab_(\d)_(\d)_branch', r'\1.\2-stable'),
        RegexpSymbolTransform(r'suc_branch', r'2.2-feature-suc'),
        RegexpSymbolTransform(r'kolab-server-(\d)-(\d)-(\d)', r'\1.\2.\3'),
        RegexpSymbolTransform(r'kolab-server-(\d)-(\d)-(\d)-(rc|beta)-(\d)', r'\1.\2.\3-\4\5'),
        RegexpSymbolTransform(r'kolab-server-(\d)-(\d)-(rc|beta)-(\d)', r'\1.\2-\3\4'),
        RegexpSymbolTransform(r'BEFORE_KONSEC_ADMIN', r'1.0-before_konsec_admin'),
        RegexpSymbolTransform(r'AFTER_KONSEC_ADMIN', r'1.0-after_konsec_admin'),
        RegexpSymbolTransform(r'V1-0-BETA-2', r'1.0-beta2'),
        RegexpSymbolTransform(r'kroupware', r'1.0-kroupware'),
        RegexpSymbolTransform(r'proko2_m1', r'2.0-proko2_m1'),
        RegexpSymbolTransform(r'proko2_m2c', r'2.0-proko2_m2c'),
        RegexpSymbolTransform(r'proko2_m3', r'2.0-proko2_m3'),
        RegexpSymbolTransform(r'pre_autoperl', r'2.0-pre_autoperl'),
        RegexpSymbolTransform(r'kolab2', r'2.0-kolabd'),
        RegexpSymbolTransform(r'kolab_2_0_tag', r'2.0.0'),

        # Simple 1:1 character replacements can also be done.  The
        # following transform, which converts backslashes into forward
        # slashes, should usually be included:
        ReplaceSubstringsSymbolTransform('\\','/'),

        # This last rule eliminates leading, trailing, and repeated
        # slashes within the output symbol names:
        NormalizePathsSymbolTransform(),
        ],

    # See the definition of global_symbol_strategy_rules above for a
    # description of this option:
    symbol_strategy_rules=global_symbol_strategy_rules,
    )
-------------- next part --------------
A non-text attachment was scrubbed...
Name: not available
Type: application/pgp-signature
Size: 198 bytes
Desc: not available
URL: <http://lists.kolab.org/pipermail/devel/attachments/20100906/dcf4ef1b/attachment.sig>


More information about the devel mailing list