~bzr-pqm/bzr/bzr.dev

« back to all changes in this revision

Viewing changes to bzrlib/option.py

  • Committer: Aaron Bentley
  • Date: 2005-10-20 00:49:17 UTC
  • mto: (1185.25.1)
  • mto: This revision was merged to the branch mainline in revision 1474.
  • Revision ID: aaron.bentley@utoronto.ca-20051020004917-6c576ac8d91f46ea
Restored merge-type selection

Show diffs side-by-side

added added

removed removed

Lines of Context:
102
102
 
103
103
 
104
104
def _parse_merge_type(typestring):
105
 
    return bzrlib.commands.get_merge_type(typestring)
 
105
    return get_merge_type(typestring)
106
106
 
 
107
def get_merge_type(typestring):
 
108
    """Attempt to find the merge class/factory associated with a string."""
 
109
    from merge import merge_types
 
110
    try:
 
111
        return merge_types[typestring][0]
 
112
    except KeyError:
 
113
        templ = '%s%%7s: %%s' % (' '*12)
 
114
        lines = [templ % (f[0], f[1][1]) for f in merge_types.iteritems()]
 
115
        type_list = '\n'.join(lines)
 
116
        msg = "No known merge type %s. Supported types are:\n%s" %\
 
117
            (typestring, type_list)
 
118
        raise BzrCommandError(msg)
107
119
 
108
120
class Option(object):
109
121
    """Description of a command line option"""