Commit 1e2f3fa1 authored by Anton Shestakov's avatar Anton Shestakov
Browse files

obshistory: prepare data for displaymarkers() in a separate function

parent 292de4cca111
Pipeline #5298 passed with stage
in 5 minutes and 24 seconds
......@@ -136,6 +136,19 @@
b"patch": TEMPLATE_PATCH,
}
def _nodesandmarkers(repo, ctx, filternonlocal):
if filternonlocal:
r = obsutil.successorsandmarkers(repo, ctx)
if r is None:
r = []
for succset in sorted(r):
if succset[b'markers']:
yield (succset[b'successors'], succset[b'markers'])
else:
markers = repo.obsstore.successors.get(ctx.node(), ())
for marker in sorted(markers):
yield (marker[1], [marker])
class obsmarker_printer(logcmdutil.changesetprinter):
"""show (available) information about a node
......@@ -173,28 +186,10 @@
markerfm = fm.nested(b"markers")
# Succs markers
if self.filter is False:
succs = self.repo.obsstore.successors.get(changenode, ())
succs = sorted(succs)
for successor in succs:
displaymarkers(self.ui, markerfm, successor[1],
[successor], ctx.node(), self.repo,
self._includediff)
else:
r = obsutil.successorsandmarkers(self.repo, ctx)
if r is None:
r = []
for succset in sorted(r):
markers = succset[b"markers"]
if not markers:
continue
successors = succset[b"successors"]
displaymarkers(self.ui, markerfm, successors, markers,
ctx.node(), self.repo, self._includediff)
data = _nodesandmarkers(self.repo, ctx, self.filter)
for nodes, markers in data:
displaymarkers(self.ui, markerfm, nodes, markers, ctx.node(),
self.repo, self._includediff)
markerfm.end()
......
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