~bzr-pqm/bzr/bzr.dev

« back to all changes in this revision

Viewing changes to bzrlib/commands.py

  • Committer: Robert Collins
  • Date: 2005-09-30 02:54:51 UTC
  • mfrom: (1395)
  • mto: This revision was merged to the branch mainline in revision 1397.
  • Revision ID: robertc@robertcollins.net-20050930025451-47b9e412202be44b
symlink and weaves, whaddya know

Show diffs side-by-side

added added

removed removed

Lines of Context:
148
148
    return revs
149
149
 
150
150
 
151
 
def get_merge_type(typestring):
152
 
    """Attempt to find the merge class/factory associated with a string."""
153
 
    from merge import merge_types
154
 
    try:
155
 
        return merge_types[typestring][0]
156
 
    except KeyError:
157
 
        templ = '%s%%7s: %%s' % (' '*12)
158
 
        lines = [templ % (f[0], f[1][1]) for f in merge_types.iteritems()]
159
 
        type_list = '\n'.join(lines)
160
 
        msg = "No known merge type %s. Supported types are:\n%s" %\
161
 
            (typestring, type_list)
162
 
        raise BzrCommandError(msg)
163
 
 
164
 
 
165
151
def _builtin_commands():
166
152
    import bzrlib.builtins
167
153
    r = {}
381
367
    'long':                   None,
382
368
    'root':                   str,
383
369
    'no-backup':              None,
384
 
    'merge-type':             get_merge_type,
385
370
    'pattern':                str,
386
371
    }
387
372
 
671
656
        bzrlib.trace.log_exception('assertion failed: ' + str(e))
672
657
        return 3
673
658
    except KeyboardInterrupt, e:
674
 
        bzrlib.trace.note('interrupted')
 
659
        bzrlib.trace.log_exception('interrupted')
675
660
        return 2
676
661
    except Exception, e:
677
662
        import errno