From ec8f1a6ebb1d49a7d01b436431665dde2fec0748 Mon Sep 17 00:00:00 2001 From: mhagger Date: Sun, 7 Dec 2008 16:36:51 +0000 Subject: [PATCH] Handle --symbol-default via optparse. * cvs2svn_lib/run_options.py (RunOptions.__init__): Create IncompatibleOption. (RunOptions.process_remaining_options): Don't initialize the options attribute or process the option. git-svn-id: http://cvs2svn.tigris.org/svn/cvs2svn/trunk@4682 be7e6eca-30d4-0310-a8e5-ac0d63af7087 --- cvs2svn_lib/run_options.py | 13 ++++--------- 1 file changed, 4 insertions(+), 9 deletions(-) diff --git a/cvs2svn_lib/run_options.py b/cvs2svn_lib/run_options.py index e3d0c01c..3f8794ae 100644 --- a/cvs2svn_lib/run_options.py +++ b/cvs2svn_lib/run_options.py @@ -325,8 +325,10 @@ class RunOptions: 'a single import (usually these are unneeded)' ), )) - group.add_option(go( - '--symbol-default', type='string', + parser.set_default('symbol_default', 'heuristic') + group.add_option(IncompatibleOption( + '--symbol-default', type='choice', + choices=['heuristic', 'strict', 'branch', 'tag'], help=( 'specify how ambiguous symbols are converted. ' 'OPT is "heuristic" (default), "strict", "branch", ' @@ -657,7 +659,6 @@ class RunOptions: options = self.options - options.symbol_default = 'heuristic' options.mime_types_file = None options.auto_props_file = None options.auto_props_ignore_case = True @@ -705,12 +706,6 @@ class RunOptions: options.force_tag = True elif opt == '--exclude': options.symbol_strategy_rules.append(ExcludeRegexpStrategyRule(value)) - elif opt == '--symbol-default': - if value not in ['branch', 'tag', 'heuristic', 'strict']: - raise FatalError( - '%r is not a valid option for --symbol-default.' % (value,) - ) - options.symbol_default = value elif opt == '--keep-cvsignore': ctx.keep_cvsignore = True elif opt == '--no-cross-branch-commits': -- 2.11.4.GIT