~bzr-pqm/bzr/bzr.dev

« back to all changes in this revision

Viewing changes to bzrlib/option.py

Merge from bzr.dev

Show diffs side-by-side

added added

removed removed

Lines of Context:
17
17
# TODO: For things like --diff-prefix, we want a way to customize the display
18
18
# of the option argument.
19
19
 
 
20
import re
 
21
 
 
22
from bzrlib.lazy_import import lazy_import
 
23
lazy_import(globals(), """
20
24
import optparse
21
 
import re
22
25
 
 
26
from bzrlib import (
 
27
    errors,
 
28
    revisionspec,
 
29
    )
 
30
""")
23
31
from bzrlib.trace import warning
24
 
from bzrlib.revisionspec import RevisionSpec
25
 
from bzrlib.errors import BzrCommandError
26
32
 
27
33
 
28
34
def _parse_revision_str(revstr):
82
88
    revs = []
83
89
    sep = re.compile("\\.\\.(?!/)")
84
90
    for x in sep.split(revstr):
85
 
        revs.append(RevisionSpec.from_string(x or None))
 
91
        revs.append(revisionspec.RevisionSpec.from_string(x or None))
86
92
    return revs
87
93
 
88
94
 
100
106
        type_list = '\n'.join(lines)
101
107
        msg = "No known merge type %s. Supported types are:\n%s" %\
102
108
            (typestring, type_list)
103
 
        raise BzrCommandError(msg)
 
109
        raise errors.BzrCommandError(msg)
104
110
 
105
111
class Option(object):
106
112
    """Description of a command line option"""
191
197
    DEFAULT_VALUE = object()
192
198
 
193
199
    def error(self, message):
194
 
        raise BzrCommandError(message)
 
200
        raise errors.BzrCommandError(message)
195
201
 
196
202
 
197
203
def get_optparser(options):