~bzr-pqm/bzr/bzr.dev

« back to all changes in this revision

Viewing changes to bzrlib/commands.py

  • Committer: Aaron Bentley
  • Date: 2005-09-29 21:07:17 UTC
  • mfrom: (1393.1.6)
  • mto: (1185.25.1)
  • mto: This revision was merged to the branch mainline in revision 1419.
  • Revision ID: abentley@panoramicfeedback.com-20050929210717-cd73981590f17017
Merged the weave changes

Show diffs side-by-side

added added

removed removed

Lines of Context:
141
141
    return revs
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
 
 
158
144
def _builtin_commands():
159
145
    import bzrlib.builtins
160
146
    r = {}
374
360
    'long':                   None,
375
361
    'root':                   str,
376
362
    'no-backup':              None,
377
 
    'merge-type':             get_merge_type,
378
363
    'pattern':                str,
379
364
    }
380
365
 
664
649
        bzrlib.trace.log_exception('assertion failed: ' + str(e))
665
650
        return 3
666
651
    except KeyboardInterrupt, e:
667
 
        bzrlib.trace.note('interrupted')
 
652
        bzrlib.trace.log_exception('interrupted')
668
653
        return 2
669
654
    except Exception, e:
670
655
        import errno