~bzr-pqm/bzr/bzr.dev

« back to all changes in this revision

Viewing changes to bzrlib/commands.py

  • Committer: Martin Pool
  • Date: 2005-09-12 08:28:13 UTC
  • mto: (1185.8.2) (974.1.91)
  • mto: This revision was merged to the branch mainline in revision 1390.
  • Revision ID: mbp@sourcefrog.net-20050912082813-dd415a8dd036969d
- remove duplicate definition of get_merge_type

Show diffs side-by-side

added added

removed removed

Lines of Context:
148
148
        msg = "No known merge type %s. Supported types are:\n%s" %\
149
149
            (typestring, type_list)
150
150
        raise BzrCommandError(msg)
151
 
    
152
 
 
153
 
def get_merge_type(typestring):
154
 
    """Attempt to find the merge class/factory associated with a string."""
155
 
    from merge import merge_types
156
 
    try:
157
 
        return merge_types[typestring][0]
158
 
    except KeyError:
159
 
        templ = '%s%%7s: %%s' % (' '*12)
160
 
        lines = [templ % (f[0], f[1][1]) for f in merge_types.iteritems()]
161
 
        type_list = '\n'.join(lines)
162
 
        msg = "No known merge type %s. Supported types are:\n%s" %\
163
 
            (typestring, type_list)
164
 
        raise BzrCommandError(msg)
165
151
 
166
152
 
167
153
def _builtin_commands():