Skip to content
GitLab
Menu
Projects
Groups
Snippets
Loading...
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in / Register
Toggle navigation
Menu
Open sidebar
mercurial
evolve
Commits
f8488bdc9e4b
Commit
f8488bdc
authored
Feb 18, 2020
by
Anton Shestakov
Browse files
obslog: make note template property into notes
parent
897b371cd0c5
Changes
2
Hide whitespace changes
Inline
Side-by-side
hgext3rd/evolve/obshistory.py
View file @
f8488bdc
...
...
@@ -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_NOTE
S
=
b
"""{if(note
s, 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")}%(note
s
)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
"note
s
"
:
TEMPLATE_NOTE
S
,
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'
),
...
...
tests/test-evolve-obshistory-split.t
View file @
f8488bdc
...
...
@@ -123,7 +123,9 @@
"
parent
",
"
content
"
],
"
note
":
"
testing split
",
"
notes
":
[
"
testing split
"
],
"
operations
":
[
"
split
"
],
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
.
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment