comparison hgext3rd/topic/stack.py @ 4655:bb0a5beb0ad8

stack: remove unnecessary prefix from stack output with non-default --template "index" template keyword already exists (the current iteration of the loop), so "stack_index" it is. It follows the same convention as other template keywords, such as "files_added", "line_number", etc.
author Anton Shestakov <av6@dwimlabs.net>
date Fri, 17 May 2019 17:42:06 +0800
parents 0d05dcb8dd37
children dbf676c86244
comparison
equal deleted inserted replaced
4654:0d05dcb8dd37 4655:bb0a5beb0ad8
360 if idx is None: 360 if idx is None:
361 fm.plain(' ') 361 fm.plain(' ')
362 if ui.verbose: 362 if ui.verbose:
363 fm.plain(' ') 363 fm.plain(' ')
364 else: 364 else:
365 fm.write('topic.stack.index', '%s%%d' % prefix, idx, 365 fm.write('stack_index', '%s%%d' % prefix, idx,
366 label=labelsgen('topic.stack.index', states)) 366 label=labelsgen('topic.stack.index', states))
367 if ui.verbose: 367 if ui.verbose:
368 fm.write('topic.stack.shortnode', '(%s)', short(ctx.node()), 368 fm.write('node', '(%s)', short(ctx.node()),
369 label=labelsgen('topic.stack.shortnode', states)) 369 label=labelsgen('topic.stack.shortnode', states))
370 fm.write('topic.stack.state.symbol', '%s', symbol, 370 fm.write('symbol', '%s', symbol,
371 label=labelsgen('topic.stack.state', states)) 371 label=labelsgen('topic.stack.state', states))
372 fm.plain(' ') 372 fm.plain(' ')
373 fm.write('topic.stack.desc', '%s', ctx.description().splitlines()[0], 373 fm.write('desc', '%s', ctx.description().splitlines()[0],
374 label=labelsgen('topic.stack.desc', states)) 374 label=labelsgen('topic.stack.desc', states))
375 fm.condwrite(states != ['clean'] and idx is not None, 'topic.stack.state', 375 fm.condwrite(states != ['clean'] and idx is not None, 'state',
376 ' (%s)', fm.formatlist(states, 'topic.stack.state'), 376 ' (%s)', fm.formatlist(states, 'topic.stack.state'),
377 label=labelsgen('topic.stack.state', states)) 377 label=labelsgen('topic.stack.state', states))
378 fm.plain('\n') 378 fm.plain('\n')
379 fm.end() 379 fm.end()