repoman: auto disable bad commit opts, bug 478156
authorZac Medico <zmedico@gentoo.org>
Thu, 25 Jul 2013 18:00:20 +0000 (11:00 -0700)
committerZac Medico <zmedico@gentoo.org>
Thu, 25 Jul 2013 18:00:20 +0000 (11:00 -0700)
bin/repoman

index f21dacc1bbe4c4d91d70a706a28c08050e2880ac..bbade951126a7d6a437de5d4a444456629a1d11b 100755 (executable)
@@ -287,12 +287,6 @@ def ParseArgs(argv, qahelp):
        if opts.mode == 'ci':
                opts.mode = 'commit'  # backwards compat shortcut
 
-       if opts.mode == 'commit' and not (opts.force or opts.pretend):
-               if opts.ignore_masked:
-                       parser.error('Commit mode and --ignore-masked are not compatible')
-               if opts.without_mask:
-                       parser.error('Commit mode and --without-mask are not compatible')
-
        # Use the verbosity and quiet options to fiddle with the loglevel appropriately
        for val in range(opts.verbosity):
                logger = logging.getLogger()
@@ -302,6 +296,14 @@ def ParseArgs(argv, qahelp):
                logger = logging.getLogger()
                logger.setLevel(logger.getEffectiveLevel() + 10)
 
+       if opts.mode == 'commit' and not (opts.force or opts.pretend):
+               if opts.ignore_masked:
+                       opts.ignore_masked = False
+                       logging.warn('Commit mode automatically disables --ignore-masked')
+               if opts.without_mask:
+                       opts.without_mask = False
+                       logging.warn('Commit mode automatically disables --without-mask')
+
        return (opts, args)
 
 qahelp = {