~bzr-pqm/bzr/bzr.dev

« back to all changes in this revision

Viewing changes to bzrlib/commands.py

  • Committer: Robert Collins
  • Date: 2005-10-30 14:56:26 UTC
  • Revision ID: robertc@robertcollins.net-20051030145626-2f57bd49824dd1d7
Add a --create-prefix to the new push command.

As part of this, some option parsing errors will raise 'BzrOptionError',
allowing granular detection for decorating commands. (Robert Collins).

Show diffs side-by-side

added added

removed removed

Lines of Context:
36
36
import bzrlib
37
37
import bzrlib.trace
38
38
from bzrlib.trace import mutter, note, log_error, warning
39
 
from bzrlib.errors import BzrError, BzrCheckError, BzrCommandError, NotBranchError
 
39
from bzrlib.errors import (BzrError, 
 
40
                           BzrCheckError,
 
41
                           BzrCommandError,
 
42
                           BzrOptionError,
 
43
                           NotBranchError)
40
44
from bzrlib.revisionspec import RevisionSpec
41
45
from bzrlib import BZRDIR
42
46
from bzrlib.option import Option
308
312
                else:
309
313
                    optname = a[2:]
310
314
                if optname not in cmd_options:
311
 
                    raise BzrCommandError('unknown long option %r for command %s' 
312
 
                            % (a, command.name()))
 
315
                    raise BzrOptionError('unknown long option %r for command %s'
 
316
                        % (a, command.name()))
313
317
            else:
314
318
                shortopt = a[1:]
315
319
                if shortopt in Option.SHORT_OPTIONS: