Mercurial > evolve
changeset 4950:60d2065b720b
obslog: remove now-unused code for plain styling
We now always use a non-plain formatter for the non-local-filtering
code paths, so we can remove the code for plain styling.
I couldn't figure out how to replace the fm.formatlist() by something
less about formatting, so I've only removed the irrelevant arguments
from those calls.
author | Martin von Zweigbergk <martinvonz@google.com> |
---|---|
date | Fri, 08 Nov 2019 07:19:18 -0800 |
parents | eb9bcef7cc5f |
children | 7bfd3fed5d1f |
files | hgext3rd/evolve/obshistory.py tests/test-evolve-obshistory-phase-divergent.t |
diffstat | 2 files changed, 11 insertions(+), 26 deletions(-) [+] |
line wrap: on
line diff
--- a/hgext3rd/evolve/obshistory.py Thu Nov 07 23:17:34 2019 -0800 +++ b/hgext3rd/evolve/obshistory.py Fri Nov 08 07:19:18 2019 -0800 @@ -538,7 +538,6 @@ metadata = dict(marker[3]) fm.startitem() - fm.plain(b' ') # Detect pruned revisions if len(succnodes) == 0: @@ -546,8 +545,7 @@ else: verb = b'rewritten' - fm.write(b'verb', b'%s', verb, - label=b"evolve.verb") + fm.data(verb=verb) effectflag = metadata.get(b'ef1') if effectflag is not None: @@ -575,35 +573,25 @@ effects.append(b'content') if effects: - fmteffect = fm.formatlist(effects, b'effect', sep=b', ') + fmteffect = fm.formatlist(effects, b'effect') fm.write(b'effects', b'(%s)', fmteffect) if len(succnodes) > 0: - fm.plain(b' as ') - shortsnodes = (nodemod.short(succnode) for succnode in sorted(succnodes)) - nodes = fm.formatlist(shortsnodes, b'succnode', sep=b', ') - fm.write(b'succnodes', b'%s', nodes, - label=b"evolve.node") + nodes = fm.formatlist(shortsnodes, b'succnode') + fm.write(b'succnodes', b'%s', nodes) operation = metadata.get(b'operation') if operation: - fm.plain(b' using ') - fm.write(b'operation', b'%s', operation, label=b"evolve.operation") - - fm.plain(b' by ') + fm.data(operation=operation) - fm.write(b'user', b'%s', metadata[b'user'], - label=b"evolve.user") - fm.plain(b' ') + fm.data(user=metadata[b'user']) - fm.write(b'date', b'(%s)', fm.formatdate(date), - label=b"evolve.date") + fm.data(date=date) # initial support for showing note if metadata.get(b'note'): - fm.plain(b'\n note: ') - fm.write(b'note', b"%s", metadata[b'note'], label=b"evolve.note") + fm.data(note=metadata[b'note']) # Patch display if includediff is True: @@ -655,12 +643,9 @@ if chunk == b'\n': linestart = True ui.write(chunk, label=label) - fm.write(b'patch', b'%s', ui.popbuffer()) + fm.data(patch=ui.popbuffer()) else: - fm.write(b'nopatchreason', b"\n (No patch available, %s)", - _patchavailable[1]) - - fm.plain(b"\n") + fm.data(nopatchreason=_patchavailable[1]) def _debugobshistorydisplaysuccsandmarkers(ui, fm, succnodes, markers, node, repo, includediff=False): """