Commit 55ebe6c4 authored by Anton Shestakov's avatar Anton Shestakov
Browse files

obslog: make date template property into dates

parent f8488bdc9e4b
......@@ -117,17 +117,22 @@ TEMPLATE_REWRITE = b"""{if(succnodes, "%(verb)s{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_DATE = b"""{label("evolve.date", "({date(date, "%a %b %d %H:%M:%S %Y %1%2")})")}"""
TEMPLATE_ONE_DATE = b"""({date(max(dates), "%a %b %d %H:%M:%S %Y %1%2")})"""
TEMPLATE_MANY_DATES = b"""(between {date(min(dates), "%a %b %d %H:%M:%S %Y %1%2")} and {date(max(dates), "%a %b %d %H:%M:%S %Y %1%2")})"""
TEMPLATE_DATES = b"""{label("evolve.date", ifeq(min(dates), max(dates), "%(onedate)s", "%(manydates)s"))}""" % {
b"onedate": TEMPLATE_ONE_DATE,
b"manydates": TEMPLATE_MANY_DATES
}
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", "%(date)s")}%(notes)s{indent(descdiff, " ")}{indent("%(patch)s", " ")}\n"}
{markers %% " {separate(" ", "%(rewrite)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"operations": TEMPLATE_OPERATIONS,
b"users": TEMPLATE_USERS,
b"date": TEMPLATE_DATE,
b"dates": TEMPLATE_DATES,
b"notes": TEMPLATE_NOTES,
b"patch": TEMPLATE_PATCH,
}
......@@ -498,7 +503,6 @@ def _debugobshistorydisplaymissingctx(fm, nodewithoutctx):
def _debugobshistorydisplaymarker(ui, fm, marker, node, repo, includediff=False):
succnodes = marker[1]
date = marker[4]
fm.startitem()
......@@ -525,7 +529,9 @@ def _debugobshistorydisplaymarker(ui, fm, marker, node, repo, includediff=False)
users = obsutil.markersusers([marker])
fm.data(users=fm.formatlist(users, name=b'user', sep=b', '))
fm.data(date=date)
# Dates
dates = obsutil.markersdates([marker])
fm.data(dates=fm.formatlist(dates, name=b'date'))
# Notes
notes = _markersnotes([marker])
......
......@@ -296,9 +296,11 @@ Check the json output is valid in this case
{
"markers": [
{
"date": [
*, (glob)
0
"dates": [
[
*, (glob)
0
]
],
"effects": [
"description",
......@@ -323,9 +325,11 @@ Check the json output is valid in this case
{
"markers": [
{
"date": [
*, (glob)
0
"dates": [
[
*, (glob)
0
]
],
"effects": [
"description",
......@@ -350,9 +354,11 @@ Check the json output is valid in this case
{
"markers": [
{
"date": [
*, (glob)
0
"dates": [
[
*, (glob)
0
]
],
"effects": [
"description",
......@@ -377,9 +383,11 @@ Check the json output is valid in this case
{
"markers": [
{
"date": [
*, (glob)
0
"dates": [
[
*, (glob)
0
]
],
"effects": [
"description",
......@@ -405,9 +413,11 @@ Check the json output is valid in this case
{
"markers": [
{
"date": [
*, (glob)
0
"dates": [
[
*, (glob)
0
]
],
"effects": [
"description",
......@@ -432,9 +442,11 @@ Check the json output is valid in this case
{
"markers": [
{
"date": [
*, (glob)
0
"dates": [
[
*, (glob)
0
]
],
"effects": [
"description",
......
......@@ -158,9 +158,11 @@ Check that obslog on ROOT with all option show everything
{
"markers": [
{
"date": [
*, (glob)
0
"dates": [
[
*, (glob)
0
]
],
"effects": [
*, (glob)
......@@ -185,9 +187,11 @@ Check that obslog on ROOT with all option show everything
{
"markers": [
{
"date": [
*, (glob)
0
"dates": [
[
*, (glob)
0
]
],
"effects": [
"description"
......@@ -210,9 +214,11 @@ Check that obslog on ROOT with all option show everything
{
"markers": [
{
"date": [
*, (glob)
0
"dates": [
[
*, (glob)
0
]
],
"effects": [
"description",
......
......@@ -151,9 +151,11 @@ Check that the same thing works with the old {shortdescription} form
{
"markers": [
{
"date": [
*, (glob)
0
"dates": [
[
*, (glob)
0
]
],
"effects": [
"description",
......@@ -200,9 +202,11 @@ Check that the same thing works with the old {shortdescription} form
{
"markers": [
{
"date": [
*, (glob)
0
"dates": [
[
*, (glob)
0
]
],
"effects": [
*, (glob)
......
......@@ -129,9 +129,11 @@ Check that with all option, every changeset is shown
{
"markers": [
{
"date": [
*, (glob)
0
"dates": [
[
*, (glob)
0
]
],
"effects": [
"description"
......@@ -148,9 +150,11 @@ Check that with all option, every changeset is shown
"verb": "reworded"
},
{
"date": [
*, (glob)
0
"dates": [
[
*, (glob)
0
]
],
"effects": [
"description"
......@@ -301,9 +305,11 @@ graph
{
"markers": [
{
"date": [
*, (glob)
0
"dates": [
[
*, (glob)
0
]
],
"effects": [
"description"
......@@ -320,9 +326,11 @@ graph
"verb": "reworded"
},
{
"date": [
*, (glob)
0
"dates": [
[
*, (glob)
0
]
],
"effects": [
"description"
......
......@@ -178,9 +178,11 @@ graph
{
"markers": [
{
"date": [
*, (glob)
0
"dates": [
[
*, (glob)
0
]
],
"effects": [
"description",
......@@ -204,9 +206,11 @@ graph
{
"markers": [
{
"date": [
*, (glob)
0
"dates": [
[
*, (glob)
0
]
],
"effects": [
"description",
......
......@@ -197,9 +197,11 @@ Actual test
{
"markers": [
{
"date": [
*, (glob)
0
"dates": [
[
*, (glob)
0
]
],
"effects": [
"parent",
......@@ -241,9 +243,11 @@ Actual test
{
"markers": [
{
"date": [
*, (glob)
0
"dates": [
[
*, (glob)
0
]
],
"effects": [
"parent",
......
......@@ -98,9 +98,11 @@ Check that with all option, every changeset is shown
{
"markers": [
{
"date": [
*, (glob)
0
"dates": [
[
*, (glob)
0
]
],
"effects": [
"description"
......@@ -205,9 +207,11 @@ graph
{
"markers": [
{
"date": [
0.0,
0
"dates": [
[
0.0,
0
]
],
"effects": [
"description"
......
......@@ -73,9 +73,11 @@ Actual test
{
"markers": [
{
"date": [
*, (glob)
0
"dates": [
[
*, (glob)
0
]
],
"operations": [
"prune"
......
......@@ -115,9 +115,11 @@ Check that debugobshistory on split commit show both targets
{
"markers": [
{
"date": [
*, (glob)
0
"dates": [
[
*, (glob)
0
]
],
"effects": [
"parent",
......
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