comparison mercurial/logcmdutil.py @ 41996:77ef3498ceb3

template: add CBOR output format The whole output is wrapped as an array just like the other serialization formats. It's an indefinite-length array since the size is unknown while encoding. Maybe we can add 'cbor-stream' (and 'pickle-stream') as needed.
author Yuya Nishihara <yuya@tcha.org>
date Sun, 10 Mar 2019 12:57:24 +0900
parents db69a763bc89
children db26dbbee74d
comparison
equal deleted inserted replaced
41995:6fef387af1da 41996:77ef3498ceb3
540 4. [ui] setting 'style' 540 4. [ui] setting 'style'
541 If all of these values are either the unset or the empty string, 541 If all of these values are either the unset or the empty string,
542 regular display via changesetprinter() is done. 542 regular display via changesetprinter() is done.
543 """ 543 """
544 postargs = (differ, opts, buffered) 544 postargs = (differ, opts, buffered)
545 if opts.get('template') == 'json': 545 if opts.get('template') in {'cbor', 'json'}:
546 fm = ui.formatter('log', opts) 546 fm = ui.formatter('log', opts)
547 return changesetformatter(ui, repo, fm, *postargs) 547 return changesetformatter(ui, repo, fm, *postargs)
548 548
549 spec = _lookuptemplate(ui, opts.get('template'), opts.get('style')) 549 spec = _lookuptemplate(ui, opts.get('template'), opts.get('style'))
550 550