Commit f8488bdc authored by Anton Shestakov's avatar Anton Shestakov
Browse files

obslog: make note template property into notes

parent 897b371cd0c5
......@@ -118,6 +118,6 @@
TEMPLATE_OPERATIONS = b"""{if(operations, "using {label("evolve.operation", join(operations, ", "))}")}"""
TEMPLATE_USERS = b"""by {label("evolve.user", join(users, ", "))}"""
TEMPLATE_DATE = b"""{label("evolve.date", "({date(date, "%a %b %d %H:%M:%S %Y %1%2")})")}"""
TEMPLATE_NOTE = b"""{if(note, "\n note: {label("evolve.note", note)}")}"""
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
......@@ -122,9 +122,9 @@
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", "%(date)s")}%(note)s{indent(descdiff, " ")}{indent("%(patch)s", " ")}\n"}
{markers %% " {separate(" ", "%(rewrite)s", "%(operations)s", "%(users)s", "%(date)s")}%(notes)s{indent(descdiff, " ")}{indent("%(patch)s", " ")}\n"}
""") % {
b"firstline": TEMPLATE_FIRST_LINE,
b"rewrite": TEMPLATE_REWRITE,
b"operations": TEMPLATE_OPERATIONS,
b"users": TEMPLATE_USERS,
b"date": TEMPLATE_DATE,
......@@ -125,10 +125,10 @@
""") % {
b"firstline": TEMPLATE_FIRST_LINE,
b"rewrite": TEMPLATE_REWRITE,
b"operations": TEMPLATE_OPERATIONS,
b"users": TEMPLATE_USERS,
b"date": TEMPLATE_DATE,
b"note": TEMPLATE_NOTE,
b"notes": TEMPLATE_NOTES,
b"patch": TEMPLATE_PATCH,
}
......@@ -499,7 +499,6 @@
def _debugobshistorydisplaymarker(ui, fm, marker, node, repo, includediff=False):
succnodes = marker[1]
date = marker[4]
metadata = dict(marker[3])
fm.startitem()
......@@ -528,9 +527,10 @@
fm.data(date=date)
# initial support for showing note
if metadata.get(b'note'):
fm.data(note=metadata[b'note'])
# Notes
notes = _markersnotes([marker])
if notes:
fm.data(notes=fm.formatlist(notes, name=b'note', sep=b'\n'))
# Patch display
if includediff is True:
......@@ -734,6 +734,11 @@
return (fate, successors)
def _markersnotes(markers):
markersmeta = [dict(m[3]) for m in markers]
notes = [meta.get(b'note') for meta in markersmeta]
return sorted(note for note in notes if note)
EFFECTMAPPING = util.sortdict([
(obsutil.DESCCHANGED, b'description'),
(obsutil.METACHANGED, b'meta'),
......
......@@ -123,7 +123,9 @@
"parent",
"content"
],
"note": "testing split",
"notes": [
"testing split"
],
"operations": [
"split"
],
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment