comparison mercurial/commands.py @ 40714:7c25d2233d53

annotate: format local tables in less-dense form I'll move these to a class, where one-extra indent will be needed.
author Yuya Nishihara <yuya@tcha.org>
date Sat, 24 Nov 2018 18:36:44 +0900
parents 9b8d1ad851f8
children e7d6a9082bdf
comparison
equal deleted inserted replaced
40713:cfaf3843491b 40714:7c25d2233d53
356 return '%s ' % shorthex(h) 356 return '%s ' % shorthex(h)
357 else: 357 else:
358 formatrev = b'%d'.__mod__ 358 formatrev = b'%d'.__mod__
359 formathex = shorthex 359 formathex = shorthex
360 360
361 opmap = [('user', ' ', lambda x: x.fctx.user(), ui.shortuser), 361 opmap = [
362 ('rev', ' ', lambda x: scmutil.intrev(x.fctx), formatrev), 362 ('user', ' ', lambda x: x.fctx.user(), ui.shortuser),
363 ('node', ' ', lambda x: hex(scmutil.binnode(x.fctx)), formathex), 363 ('rev', ' ', lambda x: scmutil.intrev(x.fctx), formatrev),
364 ('date', ' ', lambda x: x.fctx.date(), util.cachefunc(datefunc)), 364 ('node', ' ', lambda x: hex(scmutil.binnode(x.fctx)), formathex),
365 ('path', ' ', lambda x: x.fctx.path(), pycompat.bytestr), 365 ('date', ' ', lambda x: x.fctx.date(), util.cachefunc(datefunc)),
366 ('lineno', ':', lambda x: x.lineno, pycompat.bytestr), 366 ('path', ' ', lambda x: x.fctx.path(), pycompat.bytestr),
367 ] 367 ('lineno', ':', lambda x: x.lineno, pycompat.bytestr),
368 opnamemap = {'rev': 'number', 'node': 'changeset', 'path': 'file', 368 ]
369 'lineno': 'line_number'} 369 opnamemap = {
370 'rev': 'number',
371 'node': 'changeset',
372 'path': 'file',
373 'lineno': 'line_number',
374 }
370 375
371 if (not opts.get('user') and not opts.get('changeset') 376 if (not opts.get('user') and not opts.get('changeset')
372 and not opts.get('date') and not opts.get('file')): 377 and not opts.get('date') and not opts.get('file')):
373 opts['number'] = True 378 opts['number'] = True
374 379