# HG changeset patch # User Martin von Zweigbergk # Date 1573194290 28800 # Node ID 0ad2000854c4a91bcc7c9c58e68de1ff34a2a2fe # Parent bd992b1d44264f49d01e9fd1268c61f90662552e obslog: make reason for unavailable patch part of template We need the reason to be in the template in order to be able to templatize the whole output. diff -r bd992b1d4426 -r 0ad2000854c4 hgext3rd/evolve/obshistory.py --- a/hgext3rd/evolve/obshistory.py Thu Nov 07 16:34:01 2019 -0800 +++ b/hgext3rd/evolve/obshistory.py Thu Nov 07 22:24:50 2019 -0800 @@ -622,10 +622,8 @@ ui.write(chunk, label=label) fm.write(b'patch', b'%s', ui.popbuffer()) else: - nopatch = b" (No patch available, %s)" % _patchavailable[1] - fm.plain(b"\n") - # TODO: should be in json too - fm.plain(nopatch) + fm.write(b'nopatchreason', b"\n (No patch available, %s)", + _patchavailable[1]) fm.plain(b"\n") @@ -766,10 +764,8 @@ ui.write(chunk, label=label) fm.write(b'patch', b'%s', ui.popbuffer()) else: - nopatch = b" (No patch available, %s)" % _patchavailable[1] - fm.plain(b"\n") - # TODO: should be in json too - fm.plain(nopatch) + fm.write(b'nopatchreason', b"\n (No patch available, %s)", + _patchavailable[1]) fm.plain(b"\n")