~bzr-pqm/bzr/bzr.dev

« back to all changes in this revision

Viewing changes to bzrlib/commands.py

  • Committer: Martin Pool
  • Date: 2005-08-05 21:06:19 UTC
  • Revision ID: mbp@sourcefrog.net-20050805210619-87c2a27cdb61fef2
- merge aaron's merge improvements up to 
  aaron.bentley@utoronto.ca-20050805025423-c0434f52aa596d3e

Show diffs side-by-side

added added

removed removed

Lines of Context:
141
141
        raise BzrCommandError(msg)
142
142
    
143
143
 
 
144
def get_merge_type(typestring):
 
145
    """Attempt to find the merge class/factory associated with a string."""
 
146
    from merge import merge_types
 
147
    try:
 
148
        return merge_types[typestring][0]
 
149
    except KeyError:
 
150
        templ = '%s%%7s: %%s' % (' '*12)
 
151
        lines = [templ % (f[0], f[1][1]) for f in merge_types.iteritems()]
 
152
        type_list = '\n'.join(lines)
 
153
        msg = "No known merge type %s. Supported types are:\n%s" %\
 
154
            (typestring, type_list)
 
155
        raise BzrCommandError(msg)
 
156
    
 
157
 
144
158
 
145
159
def _get_cmd_dict(plugins_override=True):
146
160
    d = {}