comparison hgext3rd/topic/stack.py @ 4657:c24dabf8e848

stack: handle hash sizes when --debug flag is provided Since showstack() now uses fm.hexfunc() for node hashes, which depends on ui.debugflag, we should handle situations when hashes are full-sized as well.
author Anton Shestakov <av6@dwimlabs.net>
date Sat, 18 May 2019 16:56:47 +0800
parents dbf676c86244
children 89c1b739fabe
comparison
equal deleted inserted replaced
4656:dbf676c86244 4657:c24dabf8e848
356 fm.startitem() 356 fm.startitem()
357 fm.context(ctx=ctx) 357 fm.context(ctx=ctx)
358 fm.data(isentry=isentry) 358 fm.data(isentry=isentry)
359 359
360 if idx is None: 360 if idx is None:
361 fm.plain(' ') 361 spacewidth = 0
362 if ui.verbose: 362 if ui.verbose:
363 fm.plain(' ') 363 # parentheses plus short node hash
364 spacewidth = 2 + 12
365 if ui.debugflag:
366 # parentheses plus full node hash
367 spacewidth = 2 + 40
368 # s# alias width
369 spacewidth += 2
370 fm.plain(' ' * spacewidth)
364 else: 371 else:
365 fm.write('stack_index', '%s%%d' % prefix, idx, 372 fm.write('stack_index', '%s%%d' % prefix, idx,
366 label=labelsgen('topic.stack.index', states)) 373 label=labelsgen('topic.stack.index', states))
367 if ui.verbose: 374 if ui.verbose:
368 fm.write('node', '(%s)', fm.hexfunc(ctx.node()), 375 fm.write('node', '(%s)', fm.hexfunc(ctx.node()),