/brz/remove-bazaar

To get this branch, use:
bzr branch http://gegoxaren.bato24.eu/bzr/brz/remove-bazaar

« back to all changes in this revision

Viewing changes to breezy/option.py

  • Committer: Jelmer Vernooij
  • Date: 2017-07-23 22:06:41 UTC
  • mfrom: (6738 trunk)
  • mto: This revision was merged to the branch mainline in revision 6739.
  • Revision ID: jelmer@jelmer.uk-20170723220641-69eczax9bmv8d6kk
Merge trunk, address review comments.

Show diffs side-by-side

added added

removed removed

Lines of Context:
25
25
from .lazy_import import lazy_import
26
26
lazy_import(globals(), """
27
27
from breezy import (
28
 
    errors,
29
28
    revisionspec,
30
29
    i18n,
31
30
    )
32
31
""")
33
32
 
34
33
from . import (
 
34
    errors,
35
35
    registry as _mod_registry,
36
36
    )
37
37
from .sixish import (
39
39
    )
40
40
 
41
41
 
 
42
class BadOptionValue(errors.BzrError):
 
43
 
 
44
    _fmt = """Bad value "%(value)s" for option "%(name)s"."""
 
45
 
 
46
    def __init__(self, name, value):
 
47
        errors.BzrError.__init__(self, name=name, value=value)
 
48
 
 
49
 
42
50
def _parse_revision_str(revstr):
43
51
    """This handles a revision string -> revno.
44
52
 
306
314
    def validate_value(self, value):
307
315
        """Validate a value name"""
308
316
        if value not in self.registry:
309
 
            raise errors.BadOptionValue(self.name, value)
 
317
            raise BadOptionValue(self.name, value)
310
318
 
311
319
    def convert(self, value):
312
320
        """Convert a value name into an output type"""