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.
--- 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")