changeset 5261:66a913cc53af

obshistory: restructure templates a bit, drop default verb ("pruned") We always have a verb provided to the templates now, this should be fine.
author Anton Shestakov <av6@dwimlabs.net>
date Wed, 18 Mar 2020 19:20:17 +0700
parents 1e2f3fa129f2
children 0329246c70f3
files hgext3rd/evolve/obshistory.py
diffstat 1 files changed, 4 insertions(+), 4 deletions(-) [+]
line wrap: on
line diff
--- a/hgext3rd/evolve/obshistory.py	Mon Mar 16 19:13:33 2020 +0700
+++ b/hgext3rd/evolve/obshistory.py	Wed Mar 18 19:20:17 2020 +0700
@@ -108,12 +108,11 @@
     b"presentnode": TEMPLATE_PRESENT_NODE,
     b"missingnode": TEMPLATE_MISSING_NODE
 }
-TEMPLATE_VERB = b"""{label("evolve.verb", verb)}"""
 TEMPLATE_SUCCNODES = b"""{label("evolve.node", join(succnodes % "{succnode|short}", ", "))}"""
-TEMPLATE_REWRITE = b"""{if(succnodes, "%(verb)s{if(effects, "({join(effects, ", ")})")} as %(succnodes)s", "pruned")}""" % {
-    b"verb": TEMPLATE_VERB,
+TEMPLATE_NODES = b"""{if(succnodes, "as %(succnodes)s")}""" % {
     b"succnodes": TEMPLATE_SUCCNODES
 }
+TEMPLATE_REWRITE = b"""{label("evolve.verb", verb)}{if(effects, "({join(effects, ", ")})")}"""
 TEMPLATE_OPERATIONS = b"""{if(operations, "using {label("evolve.operation", join(operations, ", "))}")}"""
 TEMPLATE_USERS = b"""by {label("evolve.user", join(users, ", "))}"""
 TEMPLATE_ONE_DATE = b"""({date(max(dates), "%a %b %d %H:%M:%S %Y %1%2")})"""
@@ -125,10 +124,11 @@
 TEMPLATE_NOTES = b"""{if(notes, notes % "\n    note: {label("evolve.note", note)}")}"""
 TEMPLATE_PATCH = b"""{if(patch, "{patch}")}{if(nopatchreason, "\n(No patch available, {nopatchreason})")}"""
 DEFAULT_TEMPLATE = (b"""%(firstline)s
-{markers %% "  {separate(" ", "%(rewrite)s", "%(operations)s", "%(users)s", "%(dates)s")}%(notes)s{indent(descdiff, "    ")}{indent("%(patch)s", "    ")}\n"}
+{markers %% "  {separate(" ", "%(rewrite)s", "%(nodes)s", "%(operations)s", "%(users)s", "%(dates)s")}%(notes)s{indent(descdiff, "    ")}{indent("%(patch)s", "    ")}\n"}
 """) % {
     b"firstline": TEMPLATE_FIRST_LINE,
     b"rewrite": TEMPLATE_REWRITE,
+    b"nodes": TEMPLATE_NODES,
     b"operations": TEMPLATE_OPERATIONS,
     b"users": TEMPLATE_USERS,
     b"dates": TEMPLATE_DATES,