comparison mercurial/commands.py @ 3767:1861fa38a6a7

Move ellipsis code to util.ellipsis() and improve maxlength handling.
author Thomas Arendsen Hein <thomas@intevation.de>
date Sat, 02 Dec 2006 22:35:17 +0100
parents ad3d5b4367cb
children 73860ffbe798
comparison
equal deleted inserted replaced
3766:581665242c07 3767:1861fa38a6a7
3029 if not isinstance(inst[1], basestring): 3029 if not isinstance(inst[1], basestring):
3030 u.warn(" %r\n" % (inst[1],)) 3030 u.warn(" %r\n" % (inst[1],))
3031 elif not inst[1]: 3031 elif not inst[1]:
3032 u.warn(_(" empty string\n")) 3032 u.warn(_(" empty string\n"))
3033 else: 3033 else:
3034 u.warn("\n%r%s\n" % 3034 u.warn("\n%r\n" % util.ellipsis(inst[1]))
3035 (inst[1][:400], len(inst[1]) > 400 and '...' or ''))
3036 except util.Abort, inst: 3035 except util.Abort, inst:
3037 u.warn(_("abort: %s\n") % inst) 3036 u.warn(_("abort: %s\n") % inst)
3038 except TypeError, inst: 3037 except TypeError, inst:
3039 # was this an argument error? 3038 # was this an argument error?
3040 tb = traceback.extract_tb(sys.exc_info()[2]) 3039 tb = traceback.extract_tb(sys.exc_info()[2])